Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Why I can not update a specific confluence page content by rest api?

{
"id" : "xxxxxxx",
"type" : "page",
"title" : "xxxxxxxxx",
"body":
{
"value" : "<p><table><tr><th>head1</th><th>head2</th></tr><tr><td>value1</td><td>value2</td></tr><tr><td>value3</td><td>value4</td></tr></table></p>",
"representation" : "storage"
},
"version" : {
"number" : 2
}
}

 

I use json data like above(id and title have been insert  ),and also use "PUT" method.

The title of that page can be modified but the value is still unchanging.

Why does this happen?

Is the value unchanging in confluence page when i use rest api to call it?

Thanks for answering me!!!!

1 answer

0 votes

Hello,

Your JSON data looks to be in a good format. Since you are reporting the page title is being update but not the body then it seems like there may be an issue with the entry URI. 

What is the URI you are using to update content of an existing page? An example of this would be:

http://localhost:9999/confluence/rest/api/content/2149384202

Along with this, what is the response code you are getting from the API call?

It should be 200, 400, or 404.

Something else to keep in mind, your version must increment up from the previous update each time the call is made. The page version is dictated from Confluence and cannot be manually modified from what Confluence is reporting.

Further information on the Update Content calls can be found in the Confluence REST API Documentation (Content update)

We look forward to your response to get this issue resolved!

Regards,
Stephen Sifers

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira

Do you use Jira Cloud with Microsoft Teams?

Hi, Jira users! Do you use Jira alongside Microsoft Teams? We want to hear how you’ve used the power of Jira Cloud and Microsoft Teams (via the Jira Cloud for Microsoft Teams app) to achieve a team...

533 views 1 10
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you