Community Announcements have moved! To stay up to date, please join the new Community Announcements group today. Learn more
×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?
HI @Danu PMS ,
Might want to try process of elimination. Try adding all the classic scopes and see if it gets you moving forward, and gradually remove each one and see any changes.
Although, you might be facing this error like this post:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.