REST API: order by updated_at desc

Hi,

I need to sort pages by “updatedAt” field.

I’m trying to do Get Pages API call with order by filter.
It works correctly when I’m using “history.createdDate desc” orderBy value. But when I tried to use “history.lastUpdated.when desc” it doesn’t work. Could you please point me out how I can sort pages by updatedAt?

Hi @pem ,

What is the exact request that you sent?

If you want to get contents (of type page) and sort them with the most recently updated page on top, can you try Search content by CQL API? The request would look something like the request below; do note the use of lastmodified CQL field in the order by clause.

GET /wiki/rest/api/content/search?cql=type=page%20order%20by%20lastmodified%20desc&limit=10

Do let us know if this can address your use case.

Cheers,
Ian

1 Like