Fusion Manage Forum
Welcome to Autodesk’s Fusion Manage (formerly Fusion 360 Manage) Forum. Share your knowledge, ask questions, and explore popular Fusion Manage topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

REST API v2 - Upload problem - multiple revisions

2 REPLIES 2
Reply
Message 1 of 3
ac
Explorer
290 Views, 2 Replies

REST API v2 - Upload problem - multiple revisions

I have a problem uploading multiple revisions of the same file (i.e. attaching a file to a workspace/item). A new file works fine, the same does the second revision of the file. However, upload of the third revision always seem to fail.

 

I start uploading a new file with the following API call and JSON FileUploadRequest:

 

POST https://contex.autodeskplm360.net/api/v2/workspaces/29/items/2897/files

{"fileName":"Demo1.jpg","title":"Demo1","description":"Uploaded from Contex"}

 

This works fine and I get the usual JSON file collection in return.

 

Then I do a checkout and a second upload of the same file using the same JSON FileUploadRequest:

 

POST https://contex.autodeskplm360.net/api/v2/workspaces/29/items/2897/files/99/checkout 

POST https://contex.autodeskplm360.net/api/v2/workspaces/29/items/2897/files/99/checkin

 

This also works fine and I get an updated JSON file object in return.

 

Finally I repeat the checkout/checkin sequence for the third revison of the file now using the file ID of the second revision:

 

POST https://contex.autodeskplm360.net/api/v2/workspaces/29/items/2897/files/100/checkout
POST
https://contex.autodeskplm360.net/api/v2/workspaces/29/items/2897/files/100/checkin

The checkout works fine i.e. I get status CHECKEDOUT in return (the file also shows up checked out on the PLM web page).
However, the upload/checkin fails with the following strange JSON response leaving the file checked out:

{"errorCode":"UNKNOWN","message":"Unknown error.","params":null,"url":null,"errorClass":"APIError"}

I have also tried using the original file id (99 in this example) for the second revision chekcout, but then the checkout fails with errorcode FILE_CHECKOUT_FAILED as I would expect.

 

Am I doing something wrong or is there an API problem with multiple file revisions?

 

2 REPLIES 2
Message 2 of 3
gasevsm
in reply to: ac

Please specify the version number in your payload with every call to create a new version. Let me know how this works,

Martin Gasevski | Fusion 360 Team Product Manager
Message 3 of 3
ac
Explorer
in reply to: gasevsm

When you say payload, do you mean the JSON object sent with the checkin command?

 

I have tried the following JSON without luck:

 

{"fileName":"PageDropDemo7.jpg","title":"PageDropDemo7","description":"Uploaded from PageDrop","version":3}

 

In return I get:

 

{"errorCode":"GEN_EMPTY_INPUT","message":"Empty input.","params":null,"url":null,"errorClass":"APIError"}

 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report