Authenticating and view confluence page

I need to access confluence page for an automation project. So far, I’ve only been able to authenticate using cookies as token API didn’t work (I’ve tried both the one here and the google one (my org uses Google account to access Confluence).

This is the curl command I’ve tested:

curl -D-    -u my@email.com:mytoken    -X GET    -H "Content-Type: application/json"    https://my.org.com/confluence/rest/api/space

All attempts were unsuccessful, except when copying session cookies in my python script.
example:

requests.get('https://my.org.com/confluence/rest/api/content/search?cql=id=12345&expand=body.view', cookies=cookies)