I’m building an OAuth 2.0 app and have added all the necessary scopes. However, when I try to call the Confluence API, I get a 401 error:
{
"code": 401,
"message": "Unauthorized; scope does not match"
}Here are the scopes I’ve granted:
"scopes": [
"read:confluence-content.all",
"read:confluence-content.permission",
"read:confluence-content.summary",
"read:confluence-groups",
"read:confluence-space.summary",
"read:confluence-user"
]And here’s my API call:
curl --location 'https://api.atlassian.com/ex/confluence/<cloudid>/wiki/api/v2/spaces?limit=20' \
--header 'Authorization: Bearer <token>' \
--header 'Accept: application/json'
The <cloudid> is correct and matches the account for which the scopes are granted.
These are the Scopes given at the time of Authorization (init)
const scope =
'read:confluence-content.all ' +
'read:space-details:confluence ' +
'read:space:confluence ' +
'read:confluence-space ' +
'read:confluence-content.summary ' +
'read:confluence-space.summary ' +
'read:confluence-content.props ' +
'read:confluence-content.permission ' +
'read:confluence-user ' +
'read:confluence-groups ' +
'offline_access';
Has anyone faced this issue before? How can I resolve the “scope does not match” error for this API endpoint?