circuit-sdk

How to submit through webhooks a table with borders?


I can post tables but it's without borders..

curl -X POST "https://eu.yourcircuit.com/rest/v2/webhooks/incoming/randomID" -H "accept: application/json" -H  "content-type: application/x-www-form-urlencoded" -d "{  \"text\": \"<table><tr><td>1<\/td><td>2<\/td><\/tr><tr><td>haha<\/td><td>hihi<\/td><\/tr><\/table>\" }"

The table should have a border, but with the parameter border="1" I receive following error:

{"errorDescription":"the request contains invalid data","validationErrors":["Cannot validate the request parameter with name ::= [content]","The request parameter with name ::= [content] is forbidden by ANTISAMY"],"errorCode":"400"}

So how can I fix this? I saw a printscreen form Unify itself where the table has borders..


Solution

  • Tables are not supported in Circuit. For supported formats in Circuit see https://circuitsandbox.net/sdk/classes/Client.html#method_addTextItem.

    Having said that, simple tables are currently not blocked by the HTML validator.

    The reason your example is not working is because the html is not valid. Use this content with correct opening and closing tags.

    curl -X POST "https://eu.yourcircuit.com/rest/v2/webhooks/incoming/randomID" -H "accept: application/json" -H "content-type: application/x-www-form-urlencoded" -d "{ \"text\": \"<table border="1"><tr><td>1</td></tr><tr><td>2</td></tr></table>\" }"