cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

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

Level 8

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

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?

 

 

7 REPLIES 7

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

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

Can you try with

 

"Latest": true

 

instead of latestiteration : 1?

 

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

Thanks,

but,

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

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

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.

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

Hello,

below I am sharing my Javascript code. In this code, I am passing typeID, and properties (attributes),  also in a $filter I am setting criteria, so there I want to set a filter to fetch only latest version documents.

 

var params = {
type: 'GET',
url: me.getRestUrl() + "/structure/objects",
queryParams: {
'$select': properties,

'$filter': "endswith(number ,'"+number+"') and state eq 'Released' ",

'navigationCriteria': navigationCriteria,
'typeId': selectedTypeId,

}
};
// result: JSON
var jsonResult = me.processJSONRequest(params);

 

 

 

 

I tried with,

$filter : "latestIteration eq '1'",

but this displays all the version of a document. eg. A.1 and B.1 and B.2

I only want to fetch the latest i.e B.2

 

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

@mneumann did you got my question?

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

@shindemayur

yes, but unfortunately I can't help you here.

Someone from the Windchill Customization team might - you might have to open a Support Case for this one.

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

ok, Thank you.