Hello,
We have created a service account in our Atlassian admin settings, following the instructions in the documentation.
Using this service account, we were able to successfully connect to Jira by generating an API token.
However, for Confluence, we created credentials of the OAuth 2.0 type following the same process, but we are consistently receiving a 401 error. We have already granted the service account all 'classic' permissions within Confluence, so we don't understand why this error persists.
I am providing the configured scopes and the full error message below.
Could you please help us resolve this?
Thanks
"scope":"manage:confluence-configuration manage:jira-configuration manage:jira-data-provider manage:jira-project manage:jira-webhook manage:servicedesk-customer read:confluence-content.all read:confluence-content.permission read:confluence-content.summary read:confluence-groups read:confluence-props read:confluence-space.summary read:confluence-user read:jira-user read:jira-work read:servicedesk-request readonly:content.attachment:confluence search:confluence write:confluence-content write:confluence-file write:confluence-groups write:confluence-props write:confluence-space write:jira-work write:servicedesk-request"
{"code":401,"message":"Unauthorized; scope does not match"}
Hello @정지민 _ruirui4_
Welcome to the Atlassian community.
There is no error information included with your post.
What API endpoints are you trying to use? Can you show us the call and payload you are using?
What API endpoints are you calling? What parameters and data are you providing with that call?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For now, I am simply testing it with a curl command.
curl -H "Authorization: Bearer {TOKEN}" -H "Accept: application/json" "https://api.atlassian.com/ex/confluence/{cloudid}/api/v2/spaces"
curl -H "Authorization: Bearer {TOKEN}" -H "Accept: application/json" "https://api.atlassian.com/ex/confluence/{cloudid}/api/v2/pages"
However, 401 is returned.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
According to this documentation for the Spaces endpoint:
https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-space/#api-group-space
...for a scoped token you must have the scope "read:space:confluence" which is a Granular Scope. Your scope list shows only Classic scopes, and the API documentation does not indicate those are supported for the Spaces endpoint.
Have you tried creating a token with that granular scope and then retried the API call?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please note that I have updated the description in the main ticket. Please take a look.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.