Confluence REST API is behaving differently based on which auth mechanism is used.
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}
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
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.
@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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Very often the main issue with the OAuth API is the authentication. Do you have the OAuth credentials, and where did you get them?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.