I am using code like this:
console.log(`Space data id: ${sdata.results[0].id}`);
const pres = await api
.asUser()
.requestConfluence(route`/wiki/api/v2/spaces/${sdata.results[0].id}/pages`);
But the API call fails and the log says:
Space data id: 229380
Pages data: { "code": 401, "message": "Unauthorized; scope does not match" }
My manifest says:
permissions:
scopes:
- read:confluence-content.summary
- read:space:confluence
- read:confluence-content.all
How do I solve this such that I get an array of all pages of my space?
Note: I get the space id from a comparable call that does work:
.requestConfluence(route`/wiki/api/v2/spaces?keys=${spaceKey}`);
first I'd like to advise you to use the Developer Community for such type of questions - you probably get better answers over there.
Having said that, I believe the API call fails due to a mismatching scope 😏. In the API docs, the scope for this method is read:page:confluence. You defined read:space:confluence.
I hope that helped already.
Cheers,
Matthias.
I am moving this to the developer community, but sadly it did not help.
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.