10-21-2022 07:56 AM
Hi,
I'm using rest API and I'm able to work with nodes as soon as I have his ID ..
but in that new case I would like to retrieve, with the REST API, the doc id of the last document that has been created
Could someone help achieve this result ?
thnaks !
10-21-2022 03:12 PM
The request for Search API is:
curl -X POST "http://localhost/alfresco/api/-default-/public/search/versions/1/search" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \"query\": { \"language\": \"afts\", \"query\": \"TYPE:'cm:content'\" }, \"paging\": { \"maxItems\": 1, \"skipCount\": 0 }, \"sort\": [ { \"type\": \"FIELD\", \"field\": \"cm:created\", \"ascending\": false } ]}"
The query from this request is:
{ "query": { "language": "afts", "query": "TYPE:'cm:content'" }, "paging": { "maxItems": 1, "skipCount": 0 }, "sort": [ { "type": "FIELD", "field": "cm:created", "ascending": false } ] }
It's just a draft for the direction to moving on. Check the properties and make a closer query string.
Explore our Alfresco products with the links below. Use labels to filter content by product module.