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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.