Hi, I am trying to use the Confluence API, end while everything works when I am using an API token without scope, whenever I try to switch to a scope token I get 401 Unauthorized errors.
Here is an exemple from i took from the API doc :
import json
import os
import requests
from requests.auth import HTTPBasicAuth
url = f"https://{your_domain}/wiki/api/v2/pages/{page_id}"
auth = HTTPBasicAuth(my_email, os.getenv("CONFLUENCE_API_TOKEN_READ_PAGE"))
headers = {"Accept": "application/json"}
response = requests.request("GET", url, headers=headers, auth=auth)
print(json.dumps(json.loads(response.text), sort_keys=True, indent=4, separators=(",", ": ")))
So when I set CONFLUENCE_API_TOKEN_READ_PAGE to my token without scopes this works and returns 200
But when I create a scoped token with scope : read:page:confluence
Then i get a 401 Unauthorized HTTP Error.
I am following the snippet from the doc almost exactly and the only thing that changes between the working version and the failing one is the Token.