【发布时间】:2021-12-01 07:25:15
【问题描述】:
我正在尝试使用 PATCH projects/:project_id/items/:item_id 端点来更新 BIM360 中项目的“displayName”属性。 Forge 文档中有一个关于如何做到这一点的示例,但由于某种原因,我收到了 400 错误。
这是我的有效载荷:
{
"jsonapi": {
"version": "1.0"
},
"data": {
"type": "items",
"id": "ITEM_URN",
"attributes": {
"displayName": "NEW_ITEM_NAME.EXTENSION"
}
}
}
这是我得到的错误:
{
"jsonapi": {
"version": "1.0"
},
"errors": [
{
"id": "a4c43bbb-9e34-4973-9f9c-58a7e1d7bdb6",
"status": "400",
"code": "BAD_INPUT",
"title": "One or more input values in the request were bad",
"detail": "Request input is invalid for this operation."
}
]
}
我成功地使用相同的端点来更改同一项目的父文件夹(如本文回答中所述:Autodesk Forge; Pragmatically changing file location without new upload),因此问题必须在更新“displayName”部分。这里是返回 200 答案的成功负载示例:
{
"jsonapi": {
"version": "1.0"
},
"data": {
"type": "items",
"id": "ITEM_URN",
"relationships": {
"parent": {
"data": {
"type": "folders",
"id": "DESTINATION_FOLDER_URN"
}
}
}
}
}
用示例伪造文档:https://forge.autodesk.com/en/docs/data/v2/reference/http/projects-project_id-items-item_id-PATCH/
为了更新“displayName”属性,我缺少什么?
【问题讨论】:
标签: autodesk-forge autodesk-bim360