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

confluence api create new page 403

chen jimmy May 9, 2016

This question is in reference to Atlassian Developer Documentation: Confluence REST API Examples

When i use http://localhost:8080/confluence/rest/api/content to create a new page, but always return with status 403, "message": "You're not allowed to view that space, or it does not exist." . why? 

Hoping to hear from you soon. please contact with me by email blemie@outlook.com

2 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 9, 2016

That's usually a case of the user issueing the REST call not having access to the space you are trying to create the page in.  Mostly, the wrong user id has been used, or they're not logging in.  (Ok, sometimes people slip up and put the wrong space in the call, but it's usually the permissions)

chen jimmy May 10, 2016

But i am the admin of this system, and another thing i need to mention, when i update a page,i have the authentication to edit the page. When create a new page, the same way doesn't work.

chen jimmy May 10, 2016

image2016-5-10 19:16:5.pngimage2016-5-10 19:16:59.png

These two are the screen shortcut. Thanks man.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 10, 2016

Ok, well, admin is not relevant, it's the question of if the user account you are using to log in over REST has create/edit rights.  When you say you "update a page" - is that over REST as well?  If so, then what is different about the authentication in your update and create calls?

chen jimmy May 10, 2016

eh, I found no matter update or create a page, the authentication process always fails. And i am so sure about the username and password are totally correct, and i have enabled the remote API setting on confluence, this is the url i used:http://localhost:8080/confluence/rest/api/content/ .  Authorization:Basic YmxlbWllOjEyMzQ1               

Except what i have mentioned, is there anything i forget to set to make it work well?

Thank you.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 11, 2016

Well, that answers it - failed authentication means it doesn't know who you are, and hence you don't have permission to make the changes.

I don't know what you're doing to authenticate though, so I can't really tell you anything more than "you need to get the authentication fixed"

chen jimmy May 11, 2016

image2016-5-12 10:25:7.png

image2016-5-12 10:27:6.png

image2016-5-12 10:29:7.png

And i add Authorization:Basic YmxlbWllOjEyMzQ1  in the http header. That's all i did to authenticate. Except these, do i need to anything else? Thank you.

0 votes
Volodymyr Krupach
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 9, 2016
chen jimmy May 10, 2016

Thanks,man. But every request i submit contains the username and password encoded with base64, i use this way to authenticate my REST call, is that wrong ? 

TAGS
AUG Leaders

Atlassian Community Events