How to pass contentStatuses in cqlContext object for CQL Search API

How to pass contentStatuses in cqlContext object for CQL Search API?
Can you share a sample request for getting items with status = current?

1 Like

Hey @JatinChopra / @raz Can you guys answer this question of mine too?

Looking at the Search endpoint on the Developer Documentation https://developer.atlassian.com/cloud/confluence/rest/api-group-search/#api-group-search

It looks as though you need to pass a cqlcontext query parameter to the endpoint as an object.

https://your-domain.atlassian.net/wiki/rest/api/search?cql=type=page&cqlcontext=%7B%22contentStatuses%22%3A%5B%22current%22%5D%7D

I found that I needed to URLEncode the entire object but this is what it looks like without the encoding:

{"contentStatuses":["current"]}

Content statuses is an array of statuses as you can pass multiple.

1 Like

This doesn’t seem to work for me. I am passing spaceKey and have a different space in CQL clause. I expect the API to give no response.
Is this specific to Confluence version?

It works great for contentStatuses, however, it does not respond as intended for spaceKey and contentID. Can you please assist me regarding this issue