ADSK: POST Complete Upload to OSS returns "InvalidUploadKey"

62 views Asked by At

Good day, I am working through the Step-by-step tutorials for the Autodesk Design Automation API and I am getting an error on Task 6 - Prepare Cloud Storage. https://aps.autodesk.com/en/docs/design-automation/v3/tutorials/revit/step6-prepare-cloud-storage/

I am able to Create an OSS Bucket and get a signed URL. When I upload a file (10MB) to the provided URL, I get a status code of 200.

When I try to complete the upload via the endpoint at the link below, I get an error, status code = 400. https://aps.autodesk.com/en/docs/data/v2/reference/http/buckets-:bucketKey-objects-:objectKey-signeds3upload-POST/

Here is the response body:

{"uploadKey":"[UPLOADKEY_REMOVED]","status":"error","reason":"InvalidUploadKey"}

The uploadKey is unchanged after it is received alongside the signed URL. The following headers are included in the POST request:

{
"Authorization": "Bearer <token>",
"Content-Type": "application/json",
"x-ads-meta-Content-Type": "application/octet-stream"
}

The uploadKey is sent as:

{
"uploadKey":"[UPLOADKEY_REMOVED]"
}

I have tried with the x-ads-meta-content-type removed from the headers, and I get the same response. Again, no change is made to the uploadKey between receiving it in step 2 in the tutorial and submitting this post request. Maybe there is something wrong with how the file is uploaded in the put request, but I get a status 200 after uploading, so not sure. I have read that escape characters can be inserted if copied, but I'm using the strings directly from step 2, no copy/modification.

Any assistance is much appreciated! Thanks

0

There are 0 answers