BIM 360 无法创建现有文件的版本
Posted
技术标签:
【中文标题】BIM 360 无法创建现有文件的版本【英文标题】:BIM 360 Unable to create version of existing file 【发布时间】:2020-08-07 07:49:48 【问题描述】:我正在按照here 的说明对文件进行版本控制。
我正在调用这个端点:“https://developer.api.autodesk.com/data/v1/projects/b.f67f2d2a-13e0-4764-9cc4-3cbb3ce4ecf8/versions”
这是我要发送的 json:
"jsonapi":"version":"1.0",
"data":
"attributes":
"extension":
"type":"versions:autodesk.core:File",
"version":"1.0"
,
"name":"saw.txt"
,
"relationships":
"item":
"data":
"type":"items",
"id":"urn:adsk.wipprod:dm.lineage:LvhVsjRMRSeilxRYaO8Blw"
,
"storage":
"data":
"type":"objects",
"id":"urn:adsk.objects:os.object:wip.dm.prod/fb277d09-7049-4474-8762-e9a5723e1e48.txt"
,
"type":"versions"
我收到的回复是:
"jsonapi":"version":"1.0","errors":["id":"7df0a3d5-376a-4607-ae7a-6726772785c4","status":"400","code":"BAD_INPUT","title":"One or more input values in the request were bad","detail":"Request input is invalid for this operation."]"
我知道项目和文件的 Id 是有效的,并且创建存储桶和上传文件已经成功。我还能做些什么来确定版本控制失败的原因?
【问题讨论】:
【参考方案1】:项目 ID 包含 'b.',这意味着您正在使用 BIM 360 文件。类型应为 versions:autodesk.bim360:File,而不是 versions:autodesk.core:File(用于其他类型的 hub 中的文件,例如 Autodesk 360) .
为 BIM 360 文件创建版本时的演示负载
"jsonapi":
"version": "1.0"
,
"data":
"type": "versions",
"attributes":
"name": "advanced.rvt",
"extension":
"type": "versions:autodesk.bim360:File",
"version": "1.0"
,
"relationships":
"items":
"data":
"type": "items",
"id": "urn:adsk.wipprod:dm.lineage:recSpZViRvmXWzVU7TKcMw"
,
"storage":
"data":
"type": "objects",
"id": "urn:adsk.objects:os.object:wip.dm.prod/05138bae-977b-4401-9846-
958968ca19ec.rvt"
同样,当您创建一个新项目(第一个版本)时,有效负载将是:
"jsonapi":
"version": "1.0"
,
"data":
"type": "items",
"attributes":
"displayName": "advanced.rvt",
"extension":
"type": "items:autodesk.bim360:File",
"version": "1.0"
,
"relationships":
"tip":
"data":
"type": "versions",
"id": "1"
,
"parent":
"data":
"type": "folders",
"id": "urn:adsk.wipprod:fs.folder:co.oWrOwMCWTpWH-_glicursA"
,
"included": [
"type": "versions",
"id": "1",
"attributes":
"name": "advanced-mott.rvt",
"extension":
"type": "versions:autodesk.bim360:File",
"version": "1.0"
,
"relationships":
"storage":
"data":
"type": "objects",
"id": "urn:adsk.objects:os.object:wip.dm.prod/caa01ab2-c1da-4e51-8ae6-
892179a12b62.rvt"
]
【讨论】:
感谢您的及时回复。如果您还没有,请考虑更新教程中的文档页面并让 API 端点指出这一点。 感谢cmets,我会转发给文档组。以上是关于BIM 360 无法创建现有文件的版本的主要内容,如果未能解决你的问题,请参考以下文章
使用 Forge DataManagement API 在 BIM360 中创建新项目版本时出现 VER_MISMATCH_MIMETYPE 错误
无法为 Autodesk BIM 360 docs 项目创建 webhook