Forums

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

Cannot make a page in a Confluence Space using REST API.

Sufficient Monk January 5, 2022

I am trying to do a post request on my companies confluence to make a page using the REST API.

When I attempt to do it, I get a JSON response saying that it is forbidden.
I am able to make a page from the GUI, but not with the REST Api.
I have done Basic Authentication for the query.
Below is a picture of the request and the response.

My Question : how can I make the page on the confluence space with the rest Api?
I have tried: making a personal access token. And then using it with my request, but that didnt work either. 

doubt2.png

1 answer

1 accepted

1 vote
Answer accepted
Pramodh M
Community Champion
January 5, 2022

Hi @Sufficient Monk 

Can you try below API and let me know the result

curl -u username:password -X POST -H 'Content-Type: application/json' \
-d '{"type":"page","title":"new page", "ancestors":[{"id":1638403}], "space":{"key":"SPACE_KEY"},"body":{"storage":{"value": "<p>This is a new page</p>","representation":"storage"}}}' \
http://confluence-site-url/rest/api/content

Thanks,
Pramodh

Pramodh M
Community Champion
January 5, 2022
Like Sufficient Monk likes this

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, loom, loom for training, loom for teaching, video training, async learning, online education, screen recording, loom tutorials, loom use cases, atlassian learning, team training tools, instructional video, virtual training tools

🛗 Elevate Your Training and Enablement with Loom

Join us June 26, 11am PT for a webinar with Atlassian Champion Robert Hean & Loom’s Brittany Soinski. Hear tips, stories, and get your burning questions answered. Learn how Loom makes training and enablement easier. Don’t miss it!

Register today
AUG Leaders

Atlassian Community Events