I am building a custom app that allows a user to connect to Atlassian via OAuth. The signup flow works. I have a token with the scope. However, when i using token to access any page in confluence, I get the following error:
response is: <Response [401]>
Error: 401
Error details: {“code”:401,“message”:“Unauthorized; scope does not match”}
The source code is:
cloudId = getAtlassianCloudId(access_token, 'confluence')
print ('cloudId is: ', cloudId)
if cloudId:
# Call Confluence API
headers = {
'Authorization': f'Bearer {access_token}',
'Accept': 'application/json'
}
api_url = f'https://api.atlassian.com/ex/confluence/{cloudId}/rest/api/v2/pages/{pageId}'
print(api_url)
response = requests.get(api_url, headers=headers)
print('response is: ', response)
if response.status_code != 200:
print(f"Error: {response.status_code}")
print(f"Error details: {response.text}")
return None
Any suggestions on what I should differently?
Thanks!