ACC API获取Issue时TwoDPushpin位置数据缺失问题咨询
ACC Issue标记点位置获取解决方案
问题说明
调用Autodesk Construction Cloud(ACC)的GET Issue接口时,返回的JSON数据中results -> linkedDocuments -> details -> position路径下的TwoDPushpin位置为空对象{}。对比旧版BIM360 API,该接口能正常返回包含x、y、z坐标的position数据:
BIM360 API返回示例:
{ "linkedDocuments": [ { "type": "TwoDVectorPushpin", "urn": "", "createdBy": "", "createdAt": "2024-02-22T08:45:15.820Z", "createdAtVersion": 1, "closedBy": null, "closedAt": null, "closedAtVersion": null, "details": { "viewable": {...}, "position": { "x": -138.13512638138647, "y": -111.15485659241676, "z": 43.54259595148501 }, ... } ] }
ACC API返回示例:
{ "linkedDocuments": [ { "type": "TwoDRasterPushpin", "urn": "", "createdBy": null, "createdAt": "2024-05-02T06:58:27.331Z", "createdAtVersion": 1, "closedBy": null, "closedAt": null, "closedAtVersion": null, "details": { "viewable": { "id": "", "viewableId": "3", "guid": "", "name": "(3)", "is3D": false }, "position": {}, ... } ] }
经多份文档测试,该问题普遍存在。
可行解决方案
方案1:显式指定返回字段
调用ACC的Issues GET接口时,添加include参数,明确要求返回linkedDocuments.details.position字段。请求示例:
GET /construction/issues/v1/projects/:projectId/issues?include=linkedDocuments.details.position
该参数会强制接口返回标记点的坐标数据,修复position为空的问题。
方案2:兼容调用BIM360旧版API
ACC项目支持兼容BIM360的Issues API端点,将请求路径中的:containerId替换为ACC项目的ID即可调用。该方式会返回与BIM360 API一致的position数据结构,无需额外参数。
相关API信息
- ACC Issues GET接口:
/construction/issues/v1/projects/:projectId/issues - BIM360 Issues接口:
/issues/v2/containers/:containerId/issues
内容的提问来源于stack exchange,提问作者Mihail Gutenev
相关产品推荐
相关产品推荐

