Skip to main content
1-Visitor
December 27, 2018
Question

How to get latest revision of a document using Rest API ?

  • December 27, 2018
  • 2 replies
  • 8852 views

Hello, 

I am using Windchill 11.1 M010.

I want to get latest revision of a document using Rest API.

 

I tried to use filter,

$filter : latestiteration eq '1',

 

but, this gives "Invalid expression".

 

Is there any way to get the latest revision of a document through Rest API?

 

 

2 replies

16-Pearl
December 27, 2018

I got this tip from one of my Windchill colleagues...

Can you try with

 

"Latest": true

 

instead of latestiteration : 1?

 

1-Visitor
December 27, 2018

Thanks,

but,

This also doesn't work. It says "Latest" is Invalid property

16-Pearl
December 27, 2018

Could you please post the complete request here?

Including any headers for Post, that contain any additional parameters.

 

This might help in seeing if there's anything off in the request itself.

12-Amethyst
June 7, 2019

This will give what you are looking for 

GET <windchill_server>:<port>/Windchill/servlet/odata/DocMgmt/Documents?$expand=Revisions
1-Visitor
June 17, 2019

Thanks amarsingh  for help.

just beginner for windchill software.so please help me some few question for it.

1. <windchill_server>:<Port>  :  which server name write in it? 

please can you explain me in deepth.?

Thank you in advance

 

GET <windchill_server>:<port>/Windchill/servlet/odata/DocMgmt/Documents?$expand=Revisions


 

12-Amethyst
June 17, 2019

Assuming you have access to a windchill server and that windchill is accessed as: 

http://windchill.yourdomain.com:80/Windchill

you can access the below REST call with this URL 

http://windchill.yourdomain.com:80/Windchill/servlet/odata/DocMgmt/Documents?$expand=Revisions

As the above REST call is a GET call you can try the above URL in a browser and you will get the response in xml format.

You want to try non GET operations like POST, DELETE, PATCH, etc, with more control over your REST request, use a REST client like Postman. With tools like Postman, you can get the REST response in JSON also by adding header 

Content-Type: application/json