Cql query using request api to confluence

hi, im using python’s request module and get a 200 only when using the base url. If i try adding /rest/api/content/search i cannot pass my query.

could it be my authentication ? im passing it like this : response = requests.get(url, auth=(email, token), params, headers=blabla).json()
i have searched the internet for a solution, read the documentation but still missing something.
thanks, any help is appreciated.

Welcome to the Atlassian developer community @Roberto1,

I don’t think there’s enough information in your question to know if it is auth. Have you tried the email & token with a simpler HTTP client like curl?

I think what would help is to see the full HTTP request that Python request is constructing. There’s a lot of methods for intercepting the HTTP request on StackOverflow and any 1 of them would help with diagnosis.

ok, after a few tests, i figured it out. i had to include the “Authorization” : “Bearer mytoken”
in the headers , i can see in the admin settings that i was authenticated.

@Roberto1,

I’m glad that you found something that works but I would like to clarify that API tokens do not require being sent as Bearer tokens. They are intended to work with simple basic auth.