This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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" | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script type="text/javascript" src="//code.jquery.com/jquery-1.10.2.min.js"></script> | |
| <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.3.1/jquery.cookie.min.js"></script> | |
| <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.1/underscore-min.js"></script> | |
| <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/backbone.js/1.0.0/backbone-min.js"></script> | |
| <script type="text/javascript" src="//cdn.worldsecuresystems.com/bcapi/bcapi-0.0.1.min.js"></script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | |
| } | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var f = BCAPI.Models.FileSystem.Root.file('hello_world.txt'); | |
| var data = 'Hello World !'; | |
| f.upload(data).done(function () { | |
| console.log('File uploaded succesfully'); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var f = BCAPI.Models.FileSystem.Root.file('hello_world.txt'); | |
| f.destroy().done(function() { | |
| console.log('File was destroyed'); | |
| }); |