I'm having difficulty understanding how I can update a specific table within Confluence without having to update the entire page or is that my only option?
def update_page(id):
url = "https://company-confluence.atlassian.net/wiki/rest/api/content/{}"
payload = json.dumps({
"body": {
"storage": {
"value": '<table border="1" class="dataframe"> <thead> <tr style="text-align: right;"> <th>Circuit Type</th> <th>Provider</th> <th>Bandwidth</th> </tr> </thead> <tbody> <tr> <td>MPLS</td> <td>Verizon1</td> <td>100M</td> </tr> <tr> <td>DIA</td> <td>Spectrum</td> <td>300M</td> </tr> </tbody> </table>',
"representation": "storage"
}
}
})
headers = {
'Authorization': 'Basic basdfklhjasjikdhf34j;l',
'Content-Type': 'application/json'
}
response = requests.request("PUT", url.format(id), headers=headers, data=payload)
data = update_page(id)
if data == 200:
print("Success")
Hi @Matt and welcome!
Unfortunately, table is part of the page content so you need to update the whole page.
Hope this helps,
Fabio
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.