CQL returning empty results

Seramme
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 29, 2023

I feel like I'm missing something obvious, but... I'm trying to use the search endpoint in REST API but no matter the search terms, it always returns empty results.

I am able to list my content by doing a GET https://<my subdomain>.atlassian.net/wiki/rest/api/content

However when I try to use the search endpoint with any CQL query, I always get 0 results. For example:

GET https://<my subdomain>.atlassian.net/wiki/rest/api/search?cql=type=page

gets:
{
    "results": [],
    "start"0,
    "limit"25,
    "size"0,
    "totalSize"0,
    "cqlQuery""type=page",
    "searchDuration"115,
    "archivedResultCount"0,
    "_links": {
        "base""https://<my subdomain>.atlassian.net/wiki",
        "context""/wiki",
        "self""https://<my subdomain>.atlassian.net/wiki/rest/api/search?cql=type=page"
    }
}
Is there some kind of setting I need to use to enable CQL? Is my CQL query wrong in any way? Is using CQL search not available for free plan users? Or is it something else that I'm missing here?
Any help would be greatly appreciated!

2 answers

0 votes
Matt Treadway
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 12, 2024

Did you ever figure this out? I am having the same issue.
in browser the results are fine, from server the call returns correctly but an empty result set.

0 votes
Aron Gombas _Midori_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 2, 2023

I tried this URL on our site and it worked as expected:

https://<my subdomain>.atlassian.net/wiki/rest/api/search?cql=type=page

If you open that URL in your browser while you are logged in, do you see a valid response? 

Your GET request looks well-formed, otherwise you'd get some error. I'd think that maybe the user you're using to authenticate the request has no access to any content on the site?!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events