I am trying to use the confluence api within a forge app to update a page on a button click. The way the API works is it fetches the page using the get page call
requestConfluence(`/wiki/api/v2/pages?body-format=storage&title=${key}`)
This returns the page in the storage representation format. I then add an item to the table on the page and update the page using the following:
let response = await requestConfluence(`/wiki/api/v2/pages/${page_id}`,{
method: 'PUT',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0'
},
body: bodyData
})Where an example of the bodyData is
"id": "29098002", "status": "current", "title": "INPIT", "body":{ "representation": "storage", "value": {}, "version": { "number": 16, "message": "Update" }, "spaceId": "163832" }
I did not include the value part of the data because it just formats itself as a table rather than keeps the plain text in this descritpion. This method works well, unless I have a task list in the table. If I have a tag <ac:task-list> on the page, it fails when I try to update the page. I get the error message
{"errors":[{"status":400,"code":"INVALID_MESSAGE","title":"Invalid message","detail":null}]}
I have the same issue when I have a <colgroup> tag in the table. Wondering if anyone can help me get around this issue?