1

According to the Forge API reference you use the Model Derivative API to extract data from a model file. I use the post job endpoint (https://developer.api.autodesk.com/modelderivative/v2/designdata/job). My application has the Model Derivative API added and I have retrieved a token with data:read and data:write. As input I have the URN of a model uploaded in an A360 Team project but the API reference states that the file needs to be uploaded to a bucket in the OSS. The response from the endpoint is status code Unauthorized.

I guess I need to upload the model into OSS. But isn't the model already uploaded into OSS by A360 Team, or do I need to do it manually before I post the job?

1 Answers1

0

Indeed OSS is the actual place where all Autodesk files are stored, but the token required to access the file depends on how it was stored.

If the file resides under an user account on A360, then you need a 3-legged token (which contains the user authorization). For this you'll need to implement a OAuth workflow. This github sample show the complete workflow (see it live here).

The 2-legged token is used to access application files (not stored/created by end-users).

Augusto Goncalves
  • 8,493
  • 2
  • 17
  • 44
  • I use a 3-legged token with data:write and data:read scopes. Still I get unauthorized from the end-point. Does the user need admin rights to post a job? –  Jul 06 '16 at 13:34
  • the job endpoint requires data:read and (data:write or data:create), see more at https://developer.autodesk.com/en/docs/model-derivative/v2/reference/http/job-POST/ – Augusto Goncalves Jul 06 '16 at 13:46
  • did the suggestion worked? would like to understand your problem better... – Augusto Goncalves Jul 11 '16 at 23:14
  • I used a 3-legged token with data:read and data:write but for some reason I still got unauthorized from the end-point. I think I will do some more tests with another modell in another project. Could it be restrictions relating to my A360 user? I am able to read the folders and add models in the A360 Team client anyway. –  Jul 12 '16 at 08:25
  • can you clarify where is the URN coming from? you said is from A360, is it from storage.id or derivative.id field? – Augusto Goncalves Jul 12 '16 at 10:36
  • It's the storage.id –  Jul 12 '16 at 10:37