Forums

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

How to update a page with Python using REST API?

Mayank Koli February 6, 2018

I am new with this confluence and want to update a confluence page automatically rather than manual effort. Can you suggest how to get start. 

 

1 answer

0 votes
Stephen Deutsch
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.
February 6, 2018

Hi Mayank,

Here is a link to show how to update a page using the REST API:

https://developer.atlassian.com/server/confluence/confluence-rest-api-examples/#update-a-page

If you look a little further down the page, then you will see an example of how to add a comment to a page in Python (in 2 steps: 1-get page, 2-add comment). You can adapt this example by getting the page similarly to step 1, but make sure to include ?expand=body.storage in the URL. Then you can re-use the JSON object you received to post back the page similar to the CURL example above. The only thing you have to remember is to update the version number (whatever is returned in step 1 plus one).

Mayank Koli February 7, 2018

Thanks Stephen for this update. I will work on this. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events