无法将文件填充到photocene中-错误代码= 4 msg =尚未实现

时间:2018-08-01 23:29:11

标签: autodesk-forge autodesk-realitycapture

我尝试通过以下curl调用将文件填充到光幕中,但未成功:

curl -v 'https://developer.api.autodesk.com/photo-to-3d/v1/file' -X 'POST' -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsImtpZCI6Imp3dF9zeW1tZXRyaWNfa2V5In0.eyJ1c2VyaWQiOiJZUlZNSlNFNTdFVzMiLCJleHAiOjE1MzMxNzI5MzgsInNjb3BlIjpbImRhdGE6d3JpdGUiLCJkYXRhOmNyZWF0ZSIsImRhdGE6cmVhZCJdLCJjbGllbnRfaWQiOiJIQXFEdEtPN1ZidVJnSDBuTDBNRkowQjAyRWxCRUszbCIsImdyYW50X2lkIjoiRGRWdk41TjdCODAycUxaaFE2RktzVWMzRUxCTGQydUgiLCJhdWQiOiJodHRwczovL2F1dG9kZXNrLmNvbS9hdWQvand0ZXhwNjAiLCJqdGkiOiJVNXhTVHBFQXllV1haQnM3elc1eElKMGtFRDBhMlZNbFU1OGF5MWJuV0xMeU9Fb05nNUE2SDRLdDVBNGpnSFRxIn0.UAeCITOgg-QRqgi8O9Ws3Uyk5N10eP51wIWB-CawOf0' -d 'photosceneid=sCn1zSOVLb7mPiKkgFRbkxCOTynOhP78F5EuuqbbYig' -d 'type=obj'  -d 'scenetype=object' -d 'gpstype=regular' -d 'file[0]=https://prod.sonautics.com/scans/s1-sample-ear-201802062058/snapshot-2018020621001063.jpg'  2> /tmp/s1-sample-ear-201802062058_20180801172526 

标准输出=

{"Usage":"0.80453681945801","Resource":"\/file","Error":{"code":"4","msg":"Not yet implemented"}}

API示例和《现场指南》使我看不到哪里出了问题。

StdErr =

    * Hostname was NOT found in DNS cache
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0*   Trying 52.10.62.203...
* Connected to developer.api.autodesk.com (52.10.62.203) port 443 (#0)
* successfully set certificate verify locations:
*   CAfile: none
  CApath: /etc/ssl/certs
* SSLv3, TLS handshake, Client hello (1):
} [data not shown]
* SSLv3, TLS handshake, Server hello (2):
{ [data not shown]
* SSLv3, TLS handshake, CERT (11):
{ [data not shown]
* SSLv3, TLS handshake, Server key exchange (12):
{ [data not shown]
* SSLv3, TLS handshake, Server finished (14):
{ [data not shown]
* SSLv3, TLS handshake, Client key exchange (16):
} [data not shown]
* SSLv3, TLS change cipher, Client hello (1):
} [data not shown]
* SSLv3, TLS handshake, Finished (20):
} [data not shown]
* SSLv3, TLS change cipher, Client hello (1):
{ [data not shown]
* SSLv3, TLS handshake, Finished (20):
{ [data not shown]
* SSL connection using ECDHE-RSA-AES128-GCM-SHA256
* Server certificate:
*    subject: businessCategory=Private Organization; 1.3.6.1.4.1.311.60.2.1.3=US; 1.3.6.1.4.1.311.60.2.1.2=Delaware; serialNumber=2401504; C=US; ST=California; L=San Rafael; O=Autodesk, Inc.; OU=IPG - Core Services; CN=developer.api.autodesk.com
*    start date: 2018-03-09 00:00:00 GMT
*    expire date: 2019-04-20 12:00:00 GMT
*    subjectAltName: developer.api.autodesk.com matched
*    issuer: C=US; O=DigiCert Inc; OU=www.digicert.com; CN=DigiCert SHA2 Extended Validation Server CA
*    SSL certificate verify ok.
> POST /photo-to-3d/v1/file HTTP/1.1
> User-Agent: curl/7.35.0
> Host: developer.api.autodesk.com
> Accept: */*
> Authorization: Bearer eyJhbGciOiJIUzI1NiIsImtpZCI6Imp3dF9zeW1tZXRyaWNfa2V5In0.eyJ1c2VyaWQiOiJZUlZNSlNFNTdFVzMiLCJleHAiOjE1MzMxNzI5MzgsInNjb3BlIjpbImRhdGE6d3JpdGUiLCJkYXRhOmNyZWF0ZSIsImRhdGE6cmVhZCJdLCJjbGllbnRfaWQiOiJIQXFEdEtPN1ZidVJnSDBuTDBNRkowQjAyRWxCRUszbCIsImdyYW50X2lkIjoiRGRWdk41TjdCODAycUxaaFE2RktzVWMzRUxCTGQydUgiLCJhdWQiOiJodHRwczovL2F1dG9kZXNrLmNvbS9hdWQvand0ZXhwNjAiLCJqdGkiOiJVNXhTVHBFQXllV1haQnM3elc1eElKMGtFRDBhMlZNbFU1OGF5MWJuV0xMeU9Fb05nNUE2SDRLdDVBNGpnSFRxIn0.UAeCITOgg-QRqgi8O9Ws3Uyk5N10eP51wIWB-CawOf0
> Content-Length: 196
> Content-Type: application/x-www-form-urlencoded
> 
} [data not shown]
* upload completely sent off: 196 out of 196 bytes
100   196    0     0  100   196      0    152  0:00:01  0:00:01 --:--:--   152< HTTP/1.1 200 OK
< Content-Type: application/json
< Date: Thu, 02 Aug 2018 00:25:30 GMT
* Server Apache/2.4.6 (CentOS) is not blacklisted
< Server: Apache/2.4.6 (CentOS)
< Set-Cookie: AWSALB=dOqkcEp8OYPvUDA9SW86BUbDR9fMvps1hOy9DgDFHWr3nxHMl8qK/pnc2C6ryLHGUZ3fi8W5ZyIujQaqj/JrW47V+ehxQMsKnIHeK4wZEneIQ/L/2dqfdCY5R+pD; Expires=Thu, 09 Aug 2018 00:25:29 GMT; Path=/
< X-Powered-By: PHP/7.0.30
< Content-Length: 97
< Connection: keep-alive
< 
{ [data not shown]
100   293  100    97  100   196     63    127  0:00:01  0:00:01 --:--:--   127
* Connection #0 to host developer.api.autodesk.com left intact

最初我尝试使用多个文件进行此操作,无论我做一个文件还是执行多个文件,都遇到相同的错误。

1 个答案:

答案 0 :(得分:0)

我认为您的curl调用“格式错误”:

curl  -v 'https://developer.api.autodesk.com/photo-to-3d/v1/file' \
-X 'POST' \
-H 'Authorization: Bearer '$TOKEN \
-d 'photosceneid=sCn1zSOVLb7mPiKkgFRbkxCOTynOhP78F5EuuqbbYig' \
-d 'type=obj'  \
-d 'scenetype=object' \
-d 'gpstype=regular' \
-d 'file[0]='$link

根据adding files to a photoscene的文档,它接受 照片场景 类型 作为调查参数或图片)和 文件[]

通过提供 gpstype 场景类型 和错误的 type < / strong>,您会遇到上述错误。

您的通话应如下:

curl  -v 'https://developer.api.autodesk.com/photo-to-3d/v1/file' \
-X 'POST' \
-H 'Authorization: Bearer '$TOKEN \
-d 'photosceneid=sCn1zSOVLb7mPiKkgFRbkxCOTynOhP78F5EuuqbbYig' \
-d 'type=image'  \
-d 'file[0]='$link

像以前一样,我强烈建议您与this collection一起使用邮递员,以避免陷入此类陷阱。