使用 Autodesk API 下载文档

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

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

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//items//versions 的版本.之后我调用 projects//versions//downloadFormats 但它返回一个空的 JSON.调用 projects//versions//downloads 返回 400 Bad Input.获取水桶的正确方法是什么?objectID 来自文档"?教程中的方法不起作用,因为 JSON 中没有存储"标签(example).

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类型items: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:58:52,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1641939.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文档   Autodesk   API

发布评论

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

>www.elefans.com

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