How can I download plan pdf file by bim360 api or sdk?

纵饮孤独 提交于 2019-12-11 20:29:43

问题


According to the documentation (https://forge.autodesk.com/en/docs/data/v2/tutorials/download-file/) I should get the storage object id from included.relationships.storage.data.id. I can do it for all files uploaded to the bim360 except plans pdf files. There is nothing about 'storage' in a whole response.

Here is "included" from my response:

''' "included": [ { "type": "versions", "id": "XXX", "attributes": { "name": "1ST FLOOR PLAN", "displayName": "1ST FLOOR PLAN", "createTime": "2019-01-10T09:19:16Z", "createUserId": "3MYGKJ73V3SD", "createUserName": "XXX", "lastModifiedTime": "2019-01-10T09:19:19Z", "lastModifiedUserId": "XXX", "lastModifiedUserName": "XXX", "versionNumber": 1, "extension": { "type": "versions:autodesk.bim360:Document", "version": "1.0", "schema": { "href": "https://developer.api.autodesk.com/schema/v1/versions/versions:autodesk.bim360:Document-1.0" }, "data": { "processState": "PROCESSING_COMPLETE", "viewableId": "1", "viewableGuid": "XXX", "viewableName": "(1)", "viewableOrder": 1, "sourceFileName": "A1-1 DIMS FIRST FLOOR DIMENSION PLAN_V1_2019-01-10_09-54-54am.pdf" } } }, "links": { "self": { "href": "XXX" } }, "relationships": { "item": { "data": { "type": "items", "id": "XXX" }, "links": { "related": { "href": "XXX" } } }, "refs": { "links": { "self": { "href": "XXX" }, "related": { "href": "XXX" } } }, "links": { "links": { "self": { "href": "XXX" } } }, "downloadFormats": { "links": { "related": { "href": "XXX" } } } } } ] '''

How can I deal with it?


回答1:


Yes, please call GET versions/:version_id/relationships/refs instead. Since the item listed in the Plan folder is a type of items:autodesk.bim360:Document, this type item won't have storage attribute shown in its responses of GET versions/:version_id and GET items/:item_id directly. see also here: Download a Document with Autodesk API



来源:https://stackoverflow.com/questions/55337746/how-can-i-download-plan-pdf-file-by-bim360-api-or-sdk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!