Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to grant permission for Confluence API to access Page Tree macro?

Alex Guo
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 19, 2023

I am trying to access the HTML content of a Confluence page using this API: https://xxxx.atlassian.net/wiki/rest/api/content/{pageId}?expand=body.view However, I get an error message like this:

 

<input type=\"hidden\" name=\"spaceKey\" value=\"WDOCS\" />\n\n            <input type=\"hidden\" name=\"i18n-pagetree.loading\" value=\"Loading...\" />\n            <input type=\"hidden\" name=\"i18n-pagetree.error.permission\" value=\"Unable to load page tree. It seems that you do not have permission to view the root page.\" />\n            <input type=\"hidden\" name=\"i18n-pagetree.eeror.general\" value=\"There was a problem retrieving the page tree. Please check the server log file for more information.\" />\n

I can see the content if I visit the link directly. But when I use the API, it says I don’t have permission. I think this is because the Confluence page uses the Page Tree macro. How can I grant permission for the API to access the Page Tree macro?

1 answer

0 votes
Fabio Racobaldo _Herzum_
Community Champion
October 23, 2023

Hi @Alex Guo and welcome,

rest API have not specific permissions and they should follow the caller user permission. It is weird that you can access page via browser and you have error using apis.

Please verify that user used for rest API is the same that you are using to access page via browser.

Fabio 

Alex Guo
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 23, 2023

Hi, thank you for your answer. I'm sure that the user I used for rest API is the same as that I used in browser

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events