Forums

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

Confluence API Page Update Returns Invalid Message when <ac:task-list> is on the Page

Spencer Kelly
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 16, 2024

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?

1 answer

0 votes
Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 21, 2024

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

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events