Been reviewing the upload steps in the API documentation but so far haven’t been able get it to work.
In this case I’m trying to automate Version uploads…
Request for ‘upload URL’ is
curl -X GET https//myshow.shotgrid.autodesk.com/api/v1/entity/Version/{VersionId}/_upload?\filename={FileName} \
-H 'Authorization: Bearer {BearerToken} \
-H 'Accept: application/json'
Result is
{
"UrlRequest": {
"data": {
"timestamp": "2021-11-23T20:20:05Z",
"upload_type": "Attachment",
"upload_id": null,
"storage_service": "s3",
"original_filename": "[FileName]",
"multipart_upload": false
},
"links": {
"upload": "https://[s3domain].amazonaws.com/[longstring1]/[longstring2]/[FileName]
?X-Amz-Algorithm=[Alg]
&X-Amz-Credential=[Creds]
&X-Amz-Date=[Date]
&X-Amz-Expires=900
&X-Amz-SignedHeaders=host
&X-Amz-Security-Token=[Token]
&X-Amz-Signature=[Signature]",
"complete_upload": "/api/v1/entity/versions/{VersionId}/_upload"
}
}
}
then the Upload request is
curl -X PUT https//myshow.shotgrid.autodesk.com/api/v1/entity/Version/${VersionId}/_upload\
?filename=[FileName]\
&signature=[Signature]\
&user_id=15\
&user_type=HumanUser\
&expiration=[Expiration]` \
-H 'Content-Type: */* \
-H 'Accept: application/json' \
-H 'Authorization: Bearer ${BearerToken}'
-d '@[FilePath]'
And I get the following error
{
"errors": [
{
"id": 1,
"status": 400,
"code": 103,
"title": "Signature did not match",
"source": {},
"detail": null,
"meta": null
}
]
}