I am trying to update the wiki page with a chart macro, but does not seem to be updating properly
Getting 200 OK response. But the page looks like this, no chart rendered
Response back has this
{code}
{"storage":{"value":"<table class=\\"wysiwyg-macro\\" style=\\"background-image: url(/wiki/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NoYXJ0Om9yaWVudGF0aW9uPXZlcnRpY2FsfHN0YWNrZWQ9dHJ1ZXxmb3JnaXZlPWZhbHNlfGRhdGFPcmllbnRhdGlvbj12ZXJ0aWNhbHx0eXBlPWJhcnx5TGFiZWw9Y291bnR8eExhYmVsPW5hbWV9&locale=en_GB&version=2);background-repeat: no-repeat;\\"> <tbody> <tr> <td class=\\"wysiwyg-macro-body\\"> <p class=\\"auto-cursor-target\\"> <br /> </p> <table class=\\"confluenceTable wrapped\\"> <tbody> <tr> <th class=\\"confluenceTh\\">col</th> <th class=\\"confluenceTh\\">test2</th> <th colspan=\\"1\\" class=\\"confluenceTh\\">test3</th> </tr> <tr> <td class=\\"confluenceTd\\">1</td> <td class=\\"confluenceTd\\">400</td> <td colspan=\\"1\\" class=\\"confluenceTd\\">6000</td> </tr> <tr> <td class=\\"confluenceTd\\">2</td> <td class=\\"confluenceTd\\">5000</td> <td colspan=\\"1\\" class=\\"confluenceTd\\">3000</td> </tr> <tr> <td class=\\"confluenceTd\\">3</td> <td class=\\"confluenceTd\\">6</td> <td colspan=\\"1\\" class=\\"confluenceTd\\">7000</td> </tr> </tbody> </table> <p class=\\"auto-cursor-target\\"> <br /> </p> </td> </tr> </tbody> </table>","representation":"storage","embeddedContent":[],"_expandable":{"content":"/rest/api/content/156246922"}}
{code}
im trying to do the same thing. make an api call to upload data which is then displayed as a chart. @akumars @Andrey Khaneev _StiltSoft_ could please provide more information/code how to do this?
Hello,
Please, take a look at this REST API. With this API you cant set new content of the page. So you need to have page storage format for this purpose. I suppose, chart macro settings will be the same for all you calls while a table with data can change. Then you can create a page with configured chart macro and a dummy table data, copy page storage format and modify its table each time you update the page.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
As I see you update the page with the page editor format, but it requires page storage format. You can find page storage format in Page Tools (three dots) -> View Storage Format.
Also I can suggest you to move the source table to another page. It is easier to update page with just a table. And on a page with the Chart macro use Page Include macro that will point on the page with the table you update.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.