I have a function that is called by my app to get the page body:
const fetchPageWithBody = async ( pageId) => {
const res = await api
.asApp()
.requestConfluence(route`/wiki/api/v2/pages/${pageId}?body-format=atlas_doc_format`, {
headers: {
'Accept': 'application/json'
}
});
console.log(`fetchPageWithBody: All info about my route /wiki/api/v2/pages/${pageId} res: ${JSON.stringify(res, null, 2)}`);
const data = await res.json();
return data;
};
This used to work without a problem. Then I was changing my app adding some permissions as I also want to update the page programatically. I ran into various permissions problems for the update which I was able to solve with adapting my manifest and code.
In the run of those fixes I had to reinstall my app. And ever since, my app works not it cannot find the page anymore. I know it is there (I can just put the REST URL in my browser and I can get it (asUser of course)
The log tells me:
INFO 2023-04-01T12:28:10.301Z 6b48afe9-2566-4e16-ac36-4060ff3c3604 fetchPageWithBody: All info about my route /wiki/api/v2/pages/3866625 res: {
"headers": {},
"ok": false,
"status": 404,
"statusText": "Not Found"
}
Getting the REST URL via the browser (if logged in):
https://gctwnl-dev.atlassian.net/wiki/api/v2/pages/3866625
gets me:
{"id":3866625,"version":{"number":19,"message":"",...
In other words, the page is there, the app has permissions:
- read:confluence-content.summary
- read:confluence-content.all
- read:page:confluence
- storage:app
- read:space:confluence
- read:confluence-props
- write:confluence-content
- write:confluence-space
- write:confluence-props
but the page is ‘Not Found’. The result is the same when I am logged out so it looks like a permissions problem in my manifest. forge lint --fix
doesn’t report any issues. Going back to previous scopes doesn’t help either. I’m out of ideas.