Skip to content

Instantly share code, notes, and snippets.

// Perform the AJAX request (make sure you've set the access token
var request =
$.ajax({
url: "/api/v2/admin/sites/current/webapps",
type: "GET",
headers: {
"Authorization": access_token
},
contentType: "application/json"
});
// Perform the AJAX request (make sure you've set the access token
var request = $.ajax({
url: "/api/v2/admin/sites/current/webapps",
type: "POST",
headers: {
"Authorization": access_token
},
contentType: "application/json",
data: '{"name": "MyWebApp"}'
}); // Request successful, response is in "msg" variable
// Perform the AJAX request (make sure you've set the access token
var request = $.ajax({
url: "/api/v2/admin/sites/current/webapps/MyWebApp/items",
type: "POST",
headers: {
"Authorization": access_token
},
contentType: "application/json",
data: '{ "name": "MyWebAppItem" }'
}); // Request successful, response is in "msg" variable
// Perform the AJAX request (make sure you've set the access token
var request = $.ajax({
url: "/api/v2/admin/sites/current/tokens",
type: "DELETE",
headers: {
"Authorization": access_token
},
contentType: "application/json",
}); // Request successful, response is in "msg" variable
request.done(function (msg) {
var apps = new BCAPI.Models.WebApp.AppCollection();
apps.fetch({
success: function (webAppItems) {
//Do something for each of the webapps found
},
error: function (webAppItems, xhr) {
// handle errors
}
});
var f = BCAPI.Models.FileSystem.Root.file('hello_world.txt');
var data = 'Hello World !';
f.upload(data).done(function () {
console.log('File uploaded succesfully');
});
var f = BCAPI.Models.FileSystem.Root.file('hello_world.txt');
f.destroy().done(function() {
console.log('File was destroyed');
});
{
"menu-**Existing menu item name** ": {
"title": "**New item name**"
}
}
{
"menu-customers": {
"title": "Members"
}
}