Quantcast
Channel: Active questions tagged atlassian-plugin-sdk - Stack Overflow
Viewing all articles
Browse latest Browse all 280

How to read a confluence page using an OAuth 2.0 custom app

$
0
0

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: 401Error 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!

Tried atlassian python library, different scopes in the developer console


Viewing all articles
Browse latest Browse all 280

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>