Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

CQL returning empty results

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!

1 answer

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.
Oct 02, 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
Site Admin
TAGS
AUG Leaders

Atlassian Community Events