Autodesk BIM360:文件夹创建 returns 400 错误请求

Autodesk BIM360: Folder Creation returns 400 Bad request

我根据 this example 使用 JSON body 通过 Postman 调用了 POST-Folder 方法。但我只收到消息“400 Bad Request”,没有任何解释。这就是我的请求:

服务地址:

https://developer.api.autodesk.com/data/v1/projects/b.5823d0b2-0000-0000-00/commands

HTTP-header

Authorization: Bearer 2_legged_token
Content-Type:  application/vnd.api+json

JSON-Body

{
   "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"
        }
    ]
}

到目前为止我发现了什么:

截至目前,您可以创建带有命令端点的 BIM 360 文档文件夹,正如您所指出的那样。为此,您可以使用:

  • 3-legged令牌
  • 2-legged token with x-user-id header, this should contain the Autodesk User ID obtained, for instance, from GET users@me端点
  • "pure" 2 足令牌将 return 错误请求(截至 August/2017)

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