我正在尝试自动桌面伪造api从图像创建网格,但无法上传照片,错误代码为19。
我试过了-
curl -X POST
https://developer.api.autodesk.com/photo-to-3d/v1/file
-H 'authorization: Bearer xxx'
-H 'cache-control: no-cache'
-H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW'
-H 'postman-token: e25fbfb0-3754-e48f-4f0f-cac34bfd9df2'
-F 'file[0]=@IMG_20200930_180808.jpg'
-F 'file[1]=@IMG_20200930_180814.jpg'
-F 'file[2]=@IMG_20200930_180820.jpg'
-F 'file[3]=@IMG_20200930_180830.jpg'
-F type=image
-F photosceneid=<some sceneid>
如果有什么东西不见了,请建议我通过邮递员使用。
正如Christian所提到的,代码19意味着你所指的照片集不存在。在上传图像之前,请确保使用POST photoscene端点创建photoscene,例如:
curl -v 'https://developer.api.autodesk.com/photo-to-3d/v1/photoscene'
-X 'POST'
-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsImtpZCI6...'
-d 'scenename=testscene'
-d 'format=rcm,rcs,ortho'
-d 'metadata_name[0]=targetcs'
-d 'metadata_value[0]=UTM84-32N'
我在同一个问题上被卡住了一段时间,但我意识到这是这里提到的同一问题。
教程和实际文档之间存在一些差异,在标题中添加"Content-Type": "application/x-www-form-urlencoded"
似乎可以解决这个问题。