Forums

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

how to update the content of a page not as a text but in table format in rest api for confluence?

Kanika October 30, 2018

I am using python to update contents of a page . now I want to insert a table in rest api, and I believe something needs to be done in the body, storage ?

please guide 

1 answer

0 votes
Stephen Sifers
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 12, 2018

Hello Kanika,

Very glad to see you're using the API to update content, it really is a very efficient way to get things done quickly and excellent when paired with automation.

With this said, if you are wanting to update the content of a Confluence page via the API you are going to need to know the storage format of what it is you are trying to edit/update. As you mentioned you want to insert a table, so the storage format of body value will be something as follows:

"body":{"storage":{"value":"<table><tbody><tr><th>Table Heading Cell 1</th> <th>Table Heading Cell 2</th></tr><tr><td>Normal Cell 1</td><td>Normal Cell 2</td>  </tr></tbody></table>","representation":"storage"}}

It seems you already have an excellent start with the API, but in the event you needed references here is the documentation for the Confluence REST API along with the documentation for Confluence Storage Formats.

I hope you find this useful and it answers your question.

Regards,
Stephen Sifers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events