Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

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!
Oct 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 Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Oct 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!
Oct 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