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
})
"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?
Hi Spencer,
Good afternoon, and thanks for reaching out. Welcome to Atlassian Community!
I'm not as familiar with the API, so although I don't have an answer to your question, I suggest you try asking Atlassian Developer Community. The folk there are more familiar with our API usage:
https://community.developer.atlassian.com/
I hope that helps! Best of luck,
Shannon S | Atlassian Cloud Support
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.