使用 forge api 列出项目 bim 360 文档 - 令牌没有权限

List project bim 360 docs with forge api - Token does not have the privilege

我正在连接到 auth forge 并成功获得 access_token:

$.ajax({
      type: "POST",
      url: "https://developer.api.autodesk.com/authentication/v1/authenticate",
      data: "client_id="+client_id+"&client_secret="+client_secret+"&grant_type=client_credentials&scope=data:read",
      success: success,
      dataType: "json"
    });

然后尝试列出 bim 360 文档中的项目,return

{ "developerMessage":"Token 没有这个请求的权限。", "moreInfo": "https://forge.autodesk.com/en/docs/oauth/v2/developers_guide/error_handling/", "errorCode": “AUTH-010”}

我在 forge 上创建了一个应用程序,并在 bim 360 文档上激活了“添加自定义集成”。 我错过了什么?

$.ajax({
          type: "GET",
          url: "https://developer.api.autodesk.com/hq/v1/accounts/"+conta_id+"/projects",
          beforeSend: function(xhr) { 
            xhr.setRequestHeader("Authorization",  "Bearer "+token); 
          },
          processData: false,
          success: success_projects,
          error: function(){
              console.log("Cannot get data");
          },
          dataType: "json"
        });

提前致谢。

我认为这是一个问题,因为范围不足,要通过端点 https://forge.autodesk.com/en/docs/bim360/v1/reference/http/projects-GET/ 列出 BIM 360 帐户中的所有项目,您需要我看不到的“account:read”范围在你的代码中。请确保至少添加此范围并重试。