Confluence content search API does not return the expected fields

Hi devs,

We are trying to use the Confluence Cloud content search API to search for content in a specific instance. However, we notice that the expected results documented was not available in the response.

In the example response, we would expect the totalSize based on the searched CQL.

However, this is not the case for the response returned. Here’s an example of the response.

{
    "results": [...results],
    "start": 0,
    "limit": 30,
    "size": 30,
    "_links": {
        "base": "https://example.atlassian.net/wiki",
        "context": "/wiki",
        "next": "/rest/api/content/search?next=true&expand=body.view&limit=30&start=30&cql=type%3Dpage",
        "self": "https://example.atlassian.net/wiki/rest/api/content/search?expand=body.view&cql=type%3Dpage"
    }
}

Would like to know if this is a known issue, or if there’s another workaround to get total size of pages in the instance?

5 Likes

I think you are hitting content/search API instead of https://developer.atlassian.com/cloud/confluence/rest/api-group-search/#api-api-search-get

Hey @JatinChopra ,

Thanks for the response. Didn’t notice that there’s a different between the 2 APIs.