Autodesk のForge APIでフォトシーンに画像ファイルを追加できません。
2 つの方法を使用してこれを試みましたが、どちらも失敗していますが、それぞれ異なるエラー メッセージが表示されます。
URL を使用してファイルを指定する:
json=`curl -v -s $FORGE_URL/photo-to-3d/v1/file \
-H "Authorization: Bearer $forge_access_token" \
-d "photosceneid=$photosceneid" \
-d 'type=image' \
-d "file[1]=http://cloud1.tri-di.com/scans/VG1.3/20200617191821/img01-cam00-USB+2.0+Camera+26.jpg"
上記のコードは、次のエラーを生成します。
{
"msg": "An error occurred while trying to copy the file",
"code": "34"
}
ローカル ファイル名を使用してファイルを指定する:
画像ファイルを含むローカル ディレクトリに cd すると、次のようにファイル [1] を指定できます。
json=`curl -v -s $FORGE_URL/photo-to-3d/v1/file \
-H "Authorization: Bearer $forge_access_token" \
-d "photosceneid=$photosceneid" \
-d 'type=image' \
-d "file[1]=img01-cam00-USB+2.0+Camera+26.jpg"
`
次に、代わりに次のエラー メッセージが表示されます。
{
"msg": "Specified image protocol is invalid",
"code": "18"
}
curl -vを呼び出すと、次のデバッグ情報が提供されます。
Trying 34.197.193.140...
* Connected to developer.api.autodesk.com (34.197.193.140) port 443 (#0)
* found 148 certificates in /etc/ssl/certs/ca-certificates.crt
* found 598 certificates in /etc/ssl/certs
* ALPN, offering http/1.1
* SSL connection using TLS1.2 / ECDHE_RSA_AES_128_GCM_SHA256
* server certificate verification OK
* server certificate status verification SKIPPED
* common name: developer.api.autodesk.com (matched)
* server certificate expiration date OK
* server certificate activation date OK
* certificate public key: RSA
* certificate version: #3
* subject: businessCategory=Private Organization,jurisdictionOfIncorporationCountryName=US,jurisdictionOfIncorporationStateOrProvinceName=Delaware,serialNumber=2401504,C=US,ST=California,L=San Rafael,O=Autodesk\, Inc.,OU=MCP-ASRD-CP,CN=developer.api.autodesk.com
* start date: Mon, 24 Feb 2020 00:00:00 GMT
* expire date: Mon, 22 Mar 2021 12:00:00 GMT
* issuer: C=US,O=DigiCert Inc,OU=www.digicert.com,CN=DigiCert SHA2 Extended Validation Server CA
* compression: NULL
* ALPN, server did not agree to a protocol
> POST /photo-to-3d/v1/file HTTP/1.1
> Host: developer.api.autodesk.com
> User-Agent: curl/7.47.0
> Accept: */*
> Authorization: Bearer eyJhbGciOiJIUzI1NiIsImtpZCI6Imp3dF9zeW1tZXRyaWNfa2V5In0.eyJzY29wZSI6WyJkYXRhOnJlYWQiLCJkYXRhOndyaXRlIl0sImNsaWVudF9pZCI6IkhBcUR0S083VmJ1UmdIMG5MME1GSjBCMDJFbEJFSzNsIiwiYXVkIjoiaHR0cHM6Ly9hdXRvZGVzay5jb20vYXVkL2p3dGV4cDYwIiwianRpIjoid2lwVWw2dGNCdndPdnYzT29jVWV0anFQNFRMOXBiZVdGZm80NGtGUWhDYVpudGJ5OXZCcFdNTWpjYU1IeDRhTSIsImV4cCI6MTU5MjQ1MDM5MH0.j2_DaSyZGhs87MqtugollT1D-1Tv4-zkBDaQwjKT8yg
> Content-Length: 142
> Content-Type: application/x-www-form-urlencoded
>
} [142 bytes data]
* upload completely sent off: 142 out of 142 bytes
< HTTP/1.1 200 OK
< Content-Type: application/json; charset=utf-8
< Date: Thu, 18 Jun 2020 02:59:26 GMT
< Server: Apache/2.4.6 (CentOS)
< X-Powered-By: PHP/7.0.33
< Content-Length: 126
< Connection: keep-alive
<