Answered

Escape quotation in custom actions

  • 13 April 2023
  • 1 reply
  • 81 views

When setting up a custom action, I am unable to properly escape quotation characters in the request body. In my particular case I am trying to include some html in the body, which in order to be proper json format needs to have the quotations escaped.

For example, I’ll attempt to have this body:

{

"type": "admin",

"message_type": "comment",

"body": "<a href=\"https://google.com\">Rupa</a>",

"admin_id": 5384099

}

But when I click next, and then come back to the body, the editor has replaced it with 

{

"type": "admin",

"message_type": "comment",

"body": "<a href="\"https://google.com\&quot;">Rupa</a>",

"admin_id": 5384099

}

Similarly, if I use single quotes, those get replaced with normal double quotes. Or if I leave the quotes out, they are added.

So clearly, the editor is trying to add quotes to the html to ‘correct’ it, but in effect is making it impossible to actually write correct json.

Is there a way to get around this, or turn this feature off? Seems poorly thought through, as I can’t imagine I’d find this helpful even if it worked properly.

icon

Best answer by Jacob Cox 22 April 2023, 19:42

View original

1 reply

Userlevel 4
Badge +5

Hi @Eric Bryan !

 

HTML tags currently aren’t supported in the request body of a Custom Action. Regarding the use of those escape slashes, I can see that you’ve reached out to our Support Team about this and they opened up an issue with our Product Team for them to look into it. For now, though, those escape slashes don’t appear to be supported either. Our Support team will reach back out to you in your conversation with any updates around that!

Reply