I am developing a function to get all pages for a user via api.
let url: string | null | undefined = '/wiki/api/v2/pages';
while (typeof url === 'string') {
let pagesFromApi = await api.asUser().requestConfluence(route`${url}`, {
headers: {
'Accept': 'application/json'
}
});
const res = await pagesFromApi.json();
console.log(res, 'this is res');
When i call this function it returns 25 documents.
HOWEVER: when i add the ?limit=25
param to the url I get a 401 unauthorized error.
Here is my manifest.yml
modules:
confluence:spacePage:
- key: chatbox-hello-world
resource: main
resolver:
function: resolver
title: chatbox
route: hello-world
function:
- key: resolver
handler: index.handler
resources:
- key: main
path: static/chatbox/build
app:
id: <my id>
permissions:
scopes:
- 'read:confluence-space.summary'
- 'read:confluence-props'
- 'read:page:confluence'
- 'read:confluence-content.all'
- 'read:confluence-content.summary'
- 'search:confluence'
- 'read:confluence-content.permission'
- 'read:confluence-user'
Please help:)