Is there any way to retrieve a list of recently archived pages?
/rest/api/content?status=archived&type=page
but it is not possible to use sorting here.
rest/api/content/search?cql=lastModified=2023-04-18%20and%20type=page
but this does not list the archived pages for me.
I saw that there is a parameter (includeArchivedSpaces), but I don't think I understand how it works (does the whole space have to be archived?). For example:
an archived subpage is not returned by the API despite the parameter being set rest/api/content/search?cql=lastModified=2023-04-20%20and%20type=page&includeArchivedSpaces=true
any other suggestions?
Hello @Agnieszka Korotkiewicz
With regard the includeArchivedSpaces parameter; Yes, that is for finding content within a space that has been archived. That parameter is not for finding content that has been archived.
It seems that you didn't notice the cqlcontext parameter that can be used with the Search content by CQL endpoint:
spaceKey
Key of the space to search against. Optional.contentId
ID of the content to search against. Optional. Must be in the space specified by spaceKey
.contentStatuses
Content statuses to search against. Optional.
So, your query would be:
rest/api/content/search?cql=lastModified=2023-04-20%20and%20type=page&cqlcontext=%7B%22contentStatuses%22%3A%5B%22archived%22%5D%7D
The reason for the funky encoding of the cqlcontext parameter is that it expects a JSON object with all the values, so you have to URLEncode it all :(
Refer to this article where it's been discussed before.
Thank you for your reply. I saw this option, but I tried to add this parameter as a string and it didn't work. However, reading carefully the part of the documentation you sent, I noticed that it should be an object...
Thank you for your help!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.