SOLVED - Cloud API: next links in results stopped working

Requesting a page with its children, for example:


I get the lists with next links, here is a snippet from a response from you (confluence cloud API) just a few minutes ago, for example:

start: 0,
limit: 25,
size: 25,
_links: {
base: "https://HOSTXXX/wiki",
context: "/wiki",
next: "/rest/api/content/1185808839/child/page?next=true&limit=25&start=25",
self: "https://HOSTXXX/wiki/rest/api/content/1185808839/child/page"

The next link you provide in this API response is broken, does not work. It returns a 404:

<message>null for uri: https://HOSTXXXX/rest/api/content/1185808839/child/page?next=true&limit=25&start=25</message>

this has worked for a long time and worked a few weeks ago, trying this today Sept 9th it does not. Other requests work as expected.

I have searched and looked through changes to the API, the only related thing I could find is the change to cursors, but in that note it clearly said that following the next links returned by the confluence API should work.

What am I missing? Please help.

BR! /marcus
Thanks to @nathanwaters for the tip on the thread on the pagination API changes, I have posted this same info and question in that thread; Upcoming changes to modernize search REST APIs

I did not see it before - I relied on the info atlassian posted on this change, this page: “Upcoming changes to Confluence Cloud REST APIs to modernize search”,

Where they wrote: “To make sure your search code continues to work before, during, and after this change, use the prev and next links returned in the HTTP response instead of constructing them yourself.”

1 Like

Might be worth replying in here: Upcoming changes to modernize search REST APIs

I can reproduce it. It also happens on /wiki/rest/api/content/1185808839/child?expand=page and on /wiki/rest/api/content/1185808839?

All I can think about for a workaround is using CQL: /wiki/rest/api/search?cql=type=page%20and%20parent=1185808839. Be aware that newly created pages can only be found a couple of seconds to a couple of minutes after creation through CQL, and sometimes there are bugs where on some instances some pages can simply not be found.

Thanks. I have made some progress. I think there may have been some slight changes in how the links node is populated, maybe. I think I will fix my code to the new.

OT: Looking at it in more detail I think it looks like that the _links object gets populated differently across different responses from the API. Not sure if that is intended. Oh well, hopefully, my stuff will soon work again.

In this error message you’re not including the whole base url https://HOSTXXX/wiki you’re missing the context /wiki

I’m just making sure this isn’t the problem before pinging the engineering team.

Yes, I think you’re right. I redid the code for how the url’s were composed and it works now.
Sorry for the confusion.

1 Like

Ah, my bad. I was confused that there was no cursor there, but I guess that is not used for the child endpoints.