简体   繁体   中英

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

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM