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

曾月 November 14, 2018

{
"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
Stephen Sifers
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 19, 2018

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
AUG Leaders

Atlassian Community Events