Programmatically PUT Storage Formatted JSON Table with Table-Filter Macro

lross
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!
March 11, 2024

Using API Endpoint - https://energyhub.atlassian.net/wiki/api/v2/pages/

ERROR:

CALLOUT_RESPONSE [121]|System.HttpResponse[Status=Bad Request, StatusCode=400]

[{"status":400,"code":"INVALID_MESSAGE","title":"Invalid message","detail":null}]}

I am successfully able to load an HTML Table, but I am unable to update the page with a table-filter macro. 

Users currently have to copy and paste into a manually added table-filter macro everyday after scheduled push, which is super inconvenient. PLEASE HELP!

JSON STRING 

"id": "PAGE_ID", 

"status": "current",

"title": "PAGE_TITLE",

"body": 

     {

     "representation": "STORAGE",

     "value": "

          <ac:structured-macro ac:name=\"table-filter\">

          <ac:parameter ac:name=\"globalFilter\">true</ac:parameter>

          <ac:rich-text-body>

          TABLE_HTML

          </ac:rich-text-body>

          </ac:structured-macro>

     "

     }, 

"version": 

     { 

     "number": VERSION_NUMBER ,  

     "message": "CRM_REPORT" 

     } 

}  

1 answer

3 votes
Stiltsoft support
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 12, 2024

Hi @lross ,

Can't see anything crucial at the first glance - can you please share the full code of the working and not working variants?

Maybe it will be more convenient to use our support portal that is confidential and where you'll be able to share your data freely.

Stiltsoft support
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 12, 2024

Also one of our developers paid attention at this part:

 "value": "

          <ac:structured-macro ac:name=\"table-filter\">

          <ac:parameter ac:name=\"globalFilter\">true</ac:parameter>

          <ac:rich-text-body>

          TABLE_HTML

          </ac:rich-text-body>

          </ac:structured-macro>

     "

Can you try to make this string a one-line string? Maybe it is so in your real code but you've just formatted it in a more easy-to-read way for the Community.

lross
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!
March 14, 2024

Thanks for your response, yep I only formatted here so that it was easier to read. I can create a support ticket. 

Like Stiltsoft support likes this

Suggest an answer

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

Atlassian Community Events