If you're unable to upload a file to the Autodesk Forge server, here are the most common causes and how to troubleshoot them:
You need a valid access token to use the Forge Data Management API.
Check:
Are you using a valid OAuth token (2-legged or 3-legged, depending on your use case)?
Is the token not expired?
Does your app have the correct scopes (e.g., data:write
, bucket:create
, data:create
)?
Fix:
Regenerate the token using the correct client ID/secret and ensure scopes are properly set.
Files in Forge are uploaded to buckets. If the bucket doesn’t exist or you don’t have permission, the upload will fail.
Check:
Does the bucket already exist?
Are you using the correct bucket key?
Is the bucket in the right region?
Fix:
Use this API to create a bucket before uploading:
http
CopyEdit
POST https://developer.api.autodesk.com/oss/v2/buckets
To upload a file, you typically use:
http
CopyEdit
PUT https://developer.api.autodesk.com/oss/v2/buckets/:bucketKey/objects/:objectName
Common issues:
File name (:objectName
) includes spaces or unsupported characters.
Content-Type header missing or incorrect.
File is too large for single PUT (Forge has limits).
Fix:
Encode object name properly (URL-safe).
Set headers like:
http
CopyEdit
Content-Type: application/octet-stream Authorization: Bearer <access_token> Content-Length: <file_size>
For large files (>100 MB), use resumable uploads.
Forge APIs are sensitive to headers.
Ensure headers include:
http
CopyEdit
Authorization: Bearer <access_token> Content-Type: application/octet-stream
Forge will typically return an error message or status code. Some common ones:
401 Unauthorized
→ Token issue
403 Forbidden
→ Invalid bucket or permission
404 Not Found
→ Bucket or object name incorrect
413 Payload Too Large
→ Use resumable uploads
Try this from command line:
bash
CopyEdit
curl -X PUT \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/octet-stream" \ --data-binary "@yourfile.dwg" \ "https://developer.api.autodesk.com/oss/v2/buckets/your-bucket/objects/yourfile.dwg"