0

I am in the process of creating a report, generated and organized from various VSTS API calls. I am running into a wall using the vss.sdk to make the requests to the git rest api. The request seemed easy enough, following from examples The Core Client SDK Documentation

VSS.require(["VSS/Controls","VSS/Service", "VSS/Controls/TreeView", "TFS/VersionControl/GitRestClient"], function(
  VSS_Controls,
  VSS_Service,
  TreeView,
  GitClient){

//...Various Functions are Defined...

module.exports.getRepos = async function(Project){ 
  var client = VSS_Service.getCollectionClient(GitClient.GitHttpClient2_1);
  return await client.getRepositories(Project);
}

The response I get back is "401: error: TF400813: The user '####MyUserID####' is not authorized to access this resource."

My tests were done on my personal VSTS account where I am an Administrator, so it shouldn't be an issue with my permissions.

Any and all thoughts\suggestions\prayers\ideas are appreciated!

4

1 回答 1

0

它基于Scopes来生成访问令牌,因此请检查您的扩展的范围(例如 vso.code_manage)

于 2017-11-28T02:12:35.170 回答