0

根据此示例,我通过带有 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 也是有效的。
  • 当我使用(肯定)错误的父文件夹时,我会收到相同的错误消息。所以也许这是一个错误的骨灰盒格式或什么?
4

1 回答 1

1

正如您所指出的,到目前为止,您可以使用命令端点创建 BIM 360 Docs 文件夹。为此,您可以使用:

对文档感到抱歉,通过命令创建 BIM 360 Docs 文件夹的端点已在几周前发布,我们刚刚完成编写文档。

于 2017-08-10T10:31:23.437 回答