I was looking to play around with the Forge API and am trying to translate a rvt file into a dwg. I am just following the steps given in the "Step-by-Step" tutorials and this second step in Task 2
says to make a post request to this endpoint to get the signed url https://developer.api.autodesk.com/oss/v2/buckets/<YOUR_BUCKET_KEY>/objects/<YOUR_OBJECT_KEY>/signeds3upload?minutesExpiration=<LIFESPAN_OF_URL>.
I make the request and receive a '{'reason': 'Field uploadKey not found'}'. Which in the steps, it shows you get the uploadKey from this endpoint ? So either I'm missing something really big here, or these steps are too smart for a 5 year old.
Here is what I'm passing into my post request:
header = {
'Authorization': 'Bearer ' access_token,
'Content-Type': 'application/json'
}
body = {
'ossbucketKey': 'bucketName',
'ossSourceFileObjectKey': 'test.rvt',
'access': 'full',
'policyKey': 'transient'
}
CodePudding user response:
Note that the new direct-to-s3 upload consists of multiple steps:
- You generate an upload URL using the GET buckets/:bucketKey/objects/:objectKey/signeds3upload
- You upload your data to the URL
- You complete the upload using the POST buckets/:bucketKey/objects/:objectKey/signeds3upload endpoint you mentioned, incl. the
uploadKey
you received in step 1
For more details you can refer to this blog post: https://forge.autodesk.com/blog/data-management-oss-object-storage-service-migrating-direct-s3-approach.