Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Date based filters not working with Confluence v1 search API using OAuth credential

Dheeraj Kholia _xWF_
July 29, 2026

Confluence REST API is behaving differently based on which auth mechanism is used.

  1. Using OAuth API URL is constructed using cloudId- cloudId is fetched using the domain/site of confluence account. https://api.atlassian.com/ex/confluence/{cloudid}/{api}

  2. Using Basic auth(API key), REST API is directly used with domain url https://<domain>.atlassian.net/wiki/rest/{api}

v1 search endpoints are behaving inconsistently with OAuth URL. While with basic auth the v1 search API works fine with date filters, OAuth based URL is not returning data with the same date filters.

OAuth Request- https://api.atlassian.com/ex/confluence/<cloudId>/wiki/rest/api/search?limit=250&expand=content.space%2Ccontent.version%2Ccontent.ancestors&cql=type%3Dattachment%20and%20lastModified%20%3E%3D%222026-07-15%22%20and%20lastModified%20%3C%3D%222026-07-29%2023%3A30%22'
--header 'Authorization: ••••••'

This request gives 0 records


Basic Auth- 'https://<domain>.atlassian.net/wiki/rest/api/search?expand=content.space%2Ccontent.version%2Ccontent.ancestors%%2Ccontent.body.storage%2Ccontent.body.atlas_doc_format&cql=type%3Dattachment%20and%20lastModified%20%3E%3D%222026-07-15%22%20and%20lastModified%20%3C%3D%222026-07-29%2023%3A30%22&limit=205'
--header 'Accept: application/json'
--header 'Authorization: ••••••'

This returns correct data count.


Is there a configuration or known issue due to which records are missing when we use cloudId based URL with OAuth credentails

2 answers

0 votes
Marc -Devoteam-
Community Champion
July 30, 2026

Hi @Dheeraj Kholia _xWF_ 

Welcome to the community.

As mentioned by @marc -Collabello--Phase Locked- where is your token in the call using OAuth, you first have to make a cal to get an OAuth token and use this token in the cal to get results.

Dheeraj Kholia _xWF_
July 30, 2026

@Marc -Devoteam-  I have generated access token using Atlassian token endpoint - https://auth.atlassian.com/oauth/token
After generating the token I have added in the authorization header.

0 votes
marc -Collabello--Phase Locked-
Community Champion
July 30, 2026

Very often the main issue with the OAuth API is the authentication.  Do you have the OAuth credentials, and where did you get them?

Dheeraj Kholia _xWF_
July 30, 2026

@marc -Collabello--Phase Locked- I have generated access token using Atlassian token endpoint - https://auth.atlassian.com/oauth/token
After generating the token I have added in the authorization header

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events