GET集线器请求返回一些但不是所有必需的集线器

时间:2019-07-04 05:38:44

标签: autodesk-forge autodesk autodesk-data-management autodesk-bim360

我正在尝试通过数据管理API访问集线器,以与Viewer一起使用,并尝试通过Issues API读取/写入BIM360问题。但是,对https://developer.api.autodesk.com/project/v1/hubs的GET请求并未返回我期望的所有集线器。

我本来以为我已经在Node-js中安装的forge-apis npm模块中可能有些过时了,所以我尝试使用Postman使用3-将发送的GET请求直接发送到https://developer.api.autodesk.com/project/v1/hubs传统的OAuth令牌,但这将返回相同的集线器。

响应包括旧BIM360团队的集线器,但似乎缺少BIM360 Design的集线器。出现的唯一BIM360设计中心是我所管理的中心。

作为参考,我的数据管理和身份验证代码与此处提供的代码基本相同: http://learnforge.autodesk.io/#/tutorials/viewhubmodels

GET请求的结果如下:

{
    "jsonapi": {
        "version": "1.0"
    },
    "links": {
        "self": {
            "href": "https://developer.api.autodesk.com/project/v1/hubs"
        }
    },
    "data": [
        {
            "type": "hubs",
            "id": "a.YnVxxx",
            "attributes": {
                "name": "xxx",
                "extension": {
                    "type": "hubs:autodesk.core:Hub",
                    "version": "1.0",
                    "schema": {
                        "href": "https://developer.api.autodesk.com/schema/v1/versions/hubs:autodesk.core:Hub-1.0"
                    },
                    "data": {}
                }
            },
            "links": {
                "self": {
                    "href": "https://developer.api.autodesk.com/project/v1/hubs/a.YnVxxx"
                }
            },
            "relationships": {
                "projects": {
                    "links": {
                        "related": {
                            "href": "https://developer.api.autodesk.com/project/v1/hubs/a.YnVzxxx/projects"
                        }
                    }
                }
            }
        },
这些

3 其中之一:

"type": "hubs",
            "id": "b.211xxx",
            "attributes": {
                "name": "xxx",
                "extension": {
                    "type": "hubs:autodesk.bim360:Account",
                    "version": "1.0",
                    "schema": {
                        "href": "https://developer.api.autodesk.com/schema/v1/versions/hubs:autodesk.bim360:Account-1.0"
                    },
                    "data": {}
                }
            },
            "links": {
                "self": {
                    "href": "https://developer.api.autodesk.com/project/v1/hubs/b.211xxx"
                }
            },
            "relationships": {
                "projects": {
                    "links": {
                        "related": {
                            "href": "https://developer.api.autodesk.com/project/v1/hubs/b.211xxx/projects"
                        }
                    }
                }
            }
        }
    ],

此警告之后:

"meta": {
        "warnings": [
            {
                "Id": null,
                "HttpStatusCode": "403",
                "ErrorCode": "BIM360DM_ERROR",
                "Title": "Unable to get hubs from BIM360DM EMEA.",
                "Detail": "You don't have permission to access this API",
                "AboutLink": null,
                "Source": [],
                "meta": []
            }
        ]
    }
}

但是,https://forge.autodesk.com/blog/bim-360-docs-api-changes-access-data-european-data-center似乎建议数据管理api应该不受服务器位置(美国或EMEA)的影响,因此我不理解该警告。

是否可以通过数据管理API访问没有管理员权限的BIM360 Design集线器?

该应用程序还已针对BIM360 API进行了配置,但我相信这只会影响我所管理的中心(我是否可以对此进行确认,因为我还打算至少查看非我中心的问题)。未来,最好写问题。

0 个答案:

没有答案