Reputation: 397
I'm making a call to GET service/api/version?nodeRef={nodeRef}
, but I want to limit the query to just the most recent version. I found this StackOverflow post which suggests the use of &filter={filterQuery?}
to filter results, but that looks like it only applies to the people query method. Is there something like this for the version method?
Upvotes: 1
Views: 712
Reputation: 48376
Before answering your specific query, a general point. Alfresco community is open source, and almost all of Alfresco Enterprise is too, so for many queries around this your best bet is simply to go and check the source code yourself! The rest APIs are held in the projects/remote-api
Looking in there, you can see that the versions webscript returns all versions for a given node. It's fairly fast to do that, so calling that and getting the most recent one isn't the end of the world
Otherwise, the slingshot node details api at http://localhost:8080/alfresco/service/slingshot/doclib2/node/{store_type}/{store_id}/{id}
(add the parts of the noderef into the URL) will return lots of information on a node quickly, including the latest version. In the JSON returned by that, inside the item key is something like
"version": "1.7",
Which gives you the latest version for the node
Some of the listing and search APIs will also include the version, but those are likely to be quite a bit more heavyweight than just getting the version history of a node
Upvotes: 1