Autodesk BIM360:文件夹创建返回400错误的请求
问题描述:
根据this example,我使用JSON体通过邮递员调用POST文件夹方法。但是我只收到“400错误请求”的消息,没有任何解释。这是我的要求是什么样子:Autodesk BIM360:文件夹创建返回400错误的请求
服务地址:
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时,我收到一个不同的错误。
- Json也有效。
- 当我(肯定)错误的父文件夹 - 缸我会收到相同的错误信息。所以也许这是一个错误的urn格式或什么?
答
截至目前,您可以使用命令端点创建BIM 360 Docs文件夹,如您所指出的那样。对于您可以使用:
- 3-legged令牌
-
2-legged令牌
x-user-id
头,这应该包含的Autodesk用户ID获得,例如,从GET [email protected]端点 - “纯” 2条腿的令牌将返回坏请求(8月/ 2017的)
很抱歉的文档,端点创建BIM 360个文档文件夹中经由命令被发布的交流两周前,我们刚刚完成编写文档。
谢谢。现在它正在工作。我想只有创建它的用户才会看到该文件夹?还是项目中的每个人都会看到它? –
除非您指定不同/特定的访问权限,否则文件和文件夹是项目明智的。 –
非常感谢 –