Hiya All,
I am currently trying to integrate with the Confluence API, to get wiki content pages to be used in a separate application. As part of this integration, I need to query content pages, and get pages updated within the last 24 hours, which is where to issue is occurring. I am getting errors when attempting to order by, or filter by the last modified date.
I have outlined more details below.
The Goal:
The Issue:
After more testing an experimentation, I have managed to achieve the desired goal using the search endpoint. The original issue was due permissions on the account making the call.
When using another account with increased permissions, I was able to make the below call, using an encoded object for the query itself.
https://{{my domain}}.atlassian.net/wiki/rest/api/content/search?limit=25&start=0&cqlcontext=%7B%22contentId%22%{{content ID}}%2C%22contentStatuses%22%3A%5B%22current%22%5D%2C%22spaceKey%22%{{space key}}%7D&cql=type%3Dpage%20and%20lastModified%3Enow%28%27-1d%27%29&expand=body.storage%2Cversion
pre-enconding = {"contentId":{{content id}},"contentStatuses":["current"],"spaceKey":{{space key}}}
hi @Ben Loseby ,
try with something like this:
https://{{your domain}}.atlassian.net/wiki/rest/api/content?orderBy=lastmodified&expand=history
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Juan Carlos Vera ,
Thanks for getting back to me.
I have just tried the above, and whilst it does not error, the API seems to be ignoring the orderBy, and still order the results by createDate in ascending order.
I tested by trying to order using the createdDate, with the below, and even then it seems to ignore the direction specified:
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.