Release of v2 Confluence REST API for Pages and Blogposts (Experimental)

Hi @TylerBrown !

We (I’m working with @SvenSchatter and @christoffer ) have some concerns about how our app would perform if expansions are not supported. We have use cases where having to fetch all the information that is needed by our app without using expansions could potentially lead to tens of thousands of requests on Confluence instances of some of our customers.

Currently all the needed information can be fetched with a single REST call that has several expansions. It is true though, that the response will have several pages, and in some cases we might need to do other REST calls to fill in information that did not fit into eg expanded children (this seems to be required if a page has more than 25 children). Getting all the information that we need can currently take several minutes using the old REST API and expansions, so we’re definitely excited to hear that the performance might get better.

In any case here’s a real-life use case that might be interesting for you to consider while designing the V2 API:

  • our app supports a concept called ‘variant’ where a page is part of a variant if it and all its ancestors have certain labels
  • at the beginning of a publishing process, we calculate which pages in a page tree belong to each of the variants that are chosen to be published
  • after that we always filter out all the pages that do not belong to currently processed variant
  • doing the variant calculations always when needed would be very inefficient, and keeping the information in memory does not need too much memory even if there is a big amount of content
  • we additionally cache some other information that is fetched on the initial REST call by adding additional expansions: eg to which space content belongs, and some history information (when content was created or last modified)

The use case requires an efficient way to get all the pages in a page tree, including the labels they have, and all the parent-child relations. We have customers that have page trees containing thousands of pages.

I think there might be several ways to support our use case efficiently also with a solution that is more restricting than current expansions. And we’re happy to change our code if the end result might perform better :slight_smile:

Would be great to hear some information about how our use case could be efficiently solved with the V2 APIs, and I would also be happy to share other cases where we’re using expansions if you’re interested :slight_smile:

Cheers,
Riku

2 Likes