Setting the background of a cell in a table using the rest API

rc December 3, 2019

I'm currently trying to set the background of a specific cell to red, but am generating:
No JSON object could be decoded

 

The request I send in is:

{"type":"page","title": "Comparison","ancestors":[{"id":122755880}], "space":{"key":"aaaa"},"body":{"storage":{"value": "<h1>Categories</h1><h2>Miscellaneous Categories</h2><table><tr><td><strong>Category</strong></td><td><strong>Duration (MM:SS)</strong></td><td><strong>Duration (MM:SS)</strong></td></tr><tr><td>File System Creation</td><td>0:52 </td><td class="highlight-red" data-highlight-colour="red" title="Background colour : Red"> 0:26</td></tr></table>", "representation":"storage"}}}

 

1 answer

0 votes
Davin Studer
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.
December 3, 2019

To me it looks like you have not escaped out the quote marks in the page content. You need to escape those out or the first quote mark it comes across it will believe ends the opening one for the storage value, which will make the rest of the stuff you have invalid JSON.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events