Search code examples
autodesk-forgeautodesk-data-management

How to get the current file version of a document using the Data Management API


I'm trying to get the version id of the file that's in BIM360. In the BIM360 UI you can click the version of a document and if you've uploaded multiple versions of a file you can select an older version and make it the current version.

This creates a new version of the document and sets the file version to that selected version.

So if I've uploaded 3 versions of a file. You will have the following document versions:

  • document 1 and file 1
  • document 2 and file 2
  • document 3 and file 3 If I then make V2 in the BIM360 UI the current I see the following version being created
  • document 4 and file 2

Now I don't know how to get this data from the Data Management API. All I can find is the latest version which will say document 4 and file 3. But I'm looking for the current version of the file, which I expect to be 2.

What I tried

I"m using the get folders content endpoint to get all the content from the folder. This way I can get all the files and their information. I get back both a document and a file for each document I see in the BIM360 UI

I'm expecting to be able to find the version of the document in the document object which should be version 4 as mentioned in the example I mentioned. And this I can find as the tip. So that's as expected

I'm also expecting to be able to find the version of the file in the file object which should be version 2 as mentioned in the example above. And this I cannot find, all I can find is the tip which is version 3. But that's not what's selected as the current file.

I've gone through all the endpoints in the Data Management API reference (https://aps.autodesk.com/en/docs/data/v2/reference/http/) but haven't found an endpoint that gives me back the data I'm looking for

So is there a way to get this file version = 2 as mentioned?


Solution

  • You could check the revisionDisplayLabel that is shown in this blog post as well: https://aps.autodesk.com/blog/promoted-restored-uploaded

    enter image description here