NodeJS 无法使用节点将文档上传到BIM 360/ACC

x8diyxa7  于 12个月前  发布在  Node.js
关注(0)|答案(1)|浏览(109)

我遵循以下分步指南(https://aps.autodesk.com/en/docs/data/v2/tutorials/upload-file/)我使用node.js与axios包来做所有的Web请求。我在第6步得到的响应似乎是好的(我得到状态200:)当我移动到第7步时,我得到一个错误声明:

errors: [
        {
          id: 'dcda72b1-04c2-441b-a928-aafbb1d32d39',
          status: '400',
          code: 'BAD_INPUT',
          title: 'Object violates schema "create_item".',
          detail: 'See meta section for details.'
        }
      ],

字符串
我认为这个问题与我将教程中的cUrl命令翻译成JavaScript并替换参数有关,我缺少了一些东西,我如何检查这一点?JSON.Stringify(data)输出的console.log如下:

{"jsonapi":{"version":"1.0"},"data":{"type":"items","attributes":{"displayName":"testing.pdf","extension":{"type":"items:autodesk.core:File","version":"1.0"}},"relationships":{"tip":{"data":{"type":"versions","id":"1"}},"parent":{"data":{"type":"folders","id":"urn:adsk.wipprod:fs.folder:co.hRlS3cVYRhuXeBmzluk9Ug"}}}},"included":[{"type":"versions","id":"1","attributes":{"name":"testing.pdf","extension":{"type":"versions:autodesk.core:File","version":"1.0"}},"relationships":{"storage":{"data":{"type":"objects"}}}}]}


任何想法都欢迎.谢谢乔纳森

gt0wga4j

gt0wga4j1#

上传文件到BIM360或ACC时,项目扩展名应为items:autodesk.bim360:File,而不是items:autodesk.core:File。版本扩展名应为versions:autodesk.bim360:File,而不是versions:autodesk.core:File
Ref:https://aps.autodesk.com/en/docs/bim360/v1/tutorials/document-management/upload-document-s3/

相关问题