使用Autodesk API下载文档

编程入门 行业动态 更新时间:2024-10-18 16:44:19
本文介绍了使用Autodesk API下载文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试从BIM 360 Docs下载文档.如果要下载类型为"type": "items:autodesk.bim360:File"的文件,我只需要获取bucketID和objectID(/projects/<projectID>/items/<itemID>)并调用buckets/<bucketID>/objects/<ObjectID>. (我使用了本教程)

I'm trying to download documents from BIM 360 Docs. If I want to download a file with the type "type": "items:autodesk.bim360:File" I just need to get the bucketID and objectID (/projects/<projectID>/items/<itemID>) and call buckets/<bucketID>/objects/<ObjectID>. (I used this tutorial)

但是如何下载类型为"type": "items:autodesk.bim360:Document"的文件?

But how do I download a file with the type "type": "items:autodesk.bim360:Document"?

首先,我获得文档/projects/<projectID>/items/<itemID>/versions的版本.之后,我调用projects/<ProjectID>/versions/<versionID>/downloadFormats,但是它返回一个空的JSON.呼叫projects/<ProjectID>/versions/<versionID>/downloads返回400错误的输入.什么是拿到桶的正确方法?来自文档"的objectID?本教程中的方法无效,因为JSON中没有存储"标记(示例).

First, I get the version of the document /projects/<projectID>/items/<itemID>/versions. After that I call projects/<ProjectID>/versions/<versionID>/downloadFormats but it returns an empty JSON. The call projects/<ProjectID>/versions/<versionID>/downloads returns a 400 Bad Input. Whats the right way to get the bucket & objectID from a "document"? The way from the tutorial doesn't work because there is no "storage" tag in the JSON (example).

推荐答案

对于BIM 360项目文件夹项目,请遵循教程此处下载文档.

For BIM 360 Project Folder items, follow the tutorial here to download document.

基本上,您将需要通过GET projects/:project_id/folders/:folder_id/contents从relationships.storage.data.id字段获取文档的URN.

Basically you will need to obtain the URN of the document from the relationships.storage.data.id field via GET projects/:project_id/folders/:folder_id/contents.

对于项目类型item:autodesk.bim360:Document,请调用GET projects/:project_id/versions/:version_id/relationships/refs以获得存储位置:

For item type items:autodesk.bim360:Document, call GET projects/:project_id/versions/:version_id/relationships/refs to obtain the storage locations:

"storage": { "meta": { "link": { "href": "/oss/v2/buckets/wipbucket/objects/urn:adsk.objects:os.object:wip.dm.prod%2F9f8bdc3f-e29c-4ada-ab7b-bb8dfa821163.pdf" } }

请参阅文档这里.

更多推荐

使用Autodesk API下载文档

本文发布于:2023-11-28 09:59:10,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1641940.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文档   Autodesk   API

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!