0

I am trying to upload a file to my bucket through this API:

https://forge.autodesk.com/en/docs/data/v2/reference/http/buckets-:bucketKey-objects-:objectKey-resumable-PUT/

I am getting a 403 error. Not quite sure why that is happening since I have created the bucket myself.


({'access-control-allow-headers': 'Authorization, Accept-Encoding, Range, Content-Type', 'access-control-allow-methods': 'GET', 'access-control-allow-origin': '*', 'content-type': 'application/json; charset=utf-8', 'date': 'Sat, 04 Jun 2022 00:23:05 GMT', 'strict-transport-security': 'max-age=31536000; includeSubDomains', 'x-ads-region': 'US', 'content-length': '28', 'connection': 'keep-alive', 'status': '403'}, b'{"reason":"No write access"}')

Rahul Bhobe
  • 4,165
  • 4
  • 17
  • 32
  • Only thing that comes to mind - did your access token have `data:write` and/or `data:create` `scope`? – Rahul Bhobe Jun 04 '22 at 01:36
  • yes, same comment here. It might be that you did not specify enough scopes. In addition, the new way of uploading by S3 signed url has been available. Please migrate the workflow with the tutorial : https://forge.autodesk.com/en/docs/data/v2/tutorials/upload-file/ – Xiaodong Liang Jun 06 '22 at 00:16
  • This is my Auth body: client_id=####&client_secret=###&grant_type=client_credentials&scope=code:all data:write data:read bucket:create bucket:delete – Ehsan Barekati Jun 06 '22 at 21:35
  • And this is the response that I get: Auth response: {'cache-control': 'no-cache, no-store, no-store', 'content-type': 'application/json;charset=utf-8', 'date': 'Mon, 06 Jun 2022 21:30:31 GMT', 'expires': 'Thu, 01 Jan 1970 00:00:00 GMT', 'pragma': 'no-cache', 'set-cookie': ####;Path=/;Secure;HttpOnly;SameSite=None', 'strict-transport-security': 'max-age=31536000; includeSubDomains', 'x-frame-options': 'SAMEORIGIN', 'content-length': '824', 'connection': 'keep-alive', 'status': '200'} – Ehsan Barekati Jun 06 '22 at 21:36
  • I added 'data:write' to the auth request, but that didn't make a difference. – Ehsan Barekati Jun 06 '22 at 21:47
  • Maybe you can call https://forge.autodesk.com/en/docs/data/v2/reference/http/buckets-:bucketKey-details-GET/ to double check the bucket information first – Emma Zhu Jun 07 '22 at 01:21
  • So I created a new bucket and it resolved the issue. Thanks for all the help guys. – Ehsan Barekati Jun 08 '22 at 18:02

0 Answers0