根据此示例,我通过带有 JSON 正文的 Postman 调用了 POST-Folder 方法。但我只收到“400 Bad Request”消息,没有任何解释。这是我的请求的样子:
服务地址:
https://developer.api.autodesk.com/data/v1/projects/b.5823d0b2-0000-0000-00/commands
HTTP 标头
Authorization: Bearer 2_legged_token
Content-Type: application/vnd.api+json
JSON 正文
{
"jsonapi": {
"version": "1.0"
},
"data": {
"type": "commands",
"attributes": {
"extension": {
"type": "commands:autodesk.core:CreateFolder",
"version": "1.0.0",
"data": {
"requiredAction": "create"
}
}
},
"relationships": {
"resources": {
"data": [
{
"type": "folders",
"id": "1"
}
]
}
}
},
"included": [
{
"type": "folders",
"id": "1",
"attributes": {
"name": "test",
"extension": {
"type": "folders:autodesk.bim360:Folder",
"version": "1.0.0"
}
},
"relationships": {
"parent": {
"data": {
"type": "folders",
"id": "urn:adsk.wipprod:fs.folder:co.Ai*****"
}
}
}
}
]
}
响应
{
"jsonapi": {
"version": "1.0"
},
"errors": [
{
"id": "f1266e76-a37e-400b-bff6-de84b11cdb00",
"status": "400",
"detail": "BadRequest"
}
]
}
到目前为止我发现了什么:
- 项目ID是正确的。当我使用错误的项目 ID 时,我会收到不同的错误。
- Json 也是有效的。
- 当我使用(肯定)错误的父文件夹时,我会收到相同的错误消息。所以也许这是一个错误的骨灰盒格式或什么?