Hi @suman151
Please find the steps for updating the page
First, make an API call to get the Content ID (Page ID) using below API
curl -u admin:admin -X GET "http://localhost:8080/confluence/rest/api/content?title=myPage Title &spaceKey=TST&expand=history"
Once you have got the page ID, make a GET call to the Page using below API
curl -u admin:admin -X GET "http://localhost:8080/confluence/rest/api/content/3473411?expand=body.storage"
Now for the important part, updating the page with the ID
curl -u admin:admin \-X PUT -H 'Content-Type: application/json' \-d '{ "id":"3604482", "type":"page", "title":"new page", "space":{"key":"TST"}, "body":{ "storage": { "value": "<p>This is the updated text for the new page</p>", "representation":"storage"}}, "version":{"number":2}}' http://localhost:8080/confluence/rest/api/content/3604482
One thing though the URL will be your base URL and then this "rest/api/content/3604482"
Other than that your REST Call looks good
Let me know if this works for you!!
Thanks,Pramodh
Welcome to the Community!!
Please follow this community link for reference
https://community.atlassian.com/t5/Confluence-questions/How-to-edit-the-page-content-using-rest-api/qaq-p/904345
Hi,
I tried the resource u have provided. But still getting the same response. And if i am not using confluence in the api then getting 405 error. So can you please help more on this.
@suman151
Are you able to successfully access confluence via UI?
If so, get the page via the GET request and we need to use that for PUT request in order to update the page.
Yes, I am able to successfully access confluence via UI and get request is also working fine. But getting 500 error when using PUT requesr type.
Thanks Pramodh
It worked for me.
It looks like you're new here. Sign in or register to get started.