Search code examples
azure-devopsazure-devops-extensionsazure-devops-rest-api

Is it possible to access the VSTS data storage from outside of VSTS?


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.


Solution

  • 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}
    

    For exmaple: enter image description here