I use the code below to access the data storage in my VSTS extension.
// Get data service
VSS.getService(VSS.ServiceIds.ExtensionData).then(function(dataService) {
// Get all document under the collection
dataService.getDocuments("MyCollection").then(function(docs) {
console.log("There are " + docs.length + " in the collection.");
});
});
Is it possible to use this in a general web app that does not use VSTS? I just want to access the data stored in a different web app.
Make a call to this URL should work:
https://{yourvstsaccount}.extmgmt.visualstudio.com/_apis/ExtensionManagement/InstalledExtensions/{extensionpublisherName}/{extensionname}/Data/Scopes/{scope}/Collections/{collectionName}/Documents/{documentName}