HTTP request raw body input form removes escaping forward slash from JSON

#1

Hi,

We are pulling data from an atom feed and displaying it in a custom generic template view in Facebook messenger using the HTTP request through the “web hook and http” action. We noticed that when the text includes escaping quotes, for example:

{“query”:{“count”:3,“created”:“2017-05-03T18:28:11Z”,“lang”:“en-US”,“results”:{“item”:[{“guid”:{“isPermaLink”:“false”,“content”:“www.example.com/123123"},“title”:"some title”,“link”:“http://www.example.cpom/our-work/someexample.html",“description”:"Lorem ipsilum etc…etc… This “Baker’s Dozen” includes escaped quotes.”,“pubDate”:“Tue, 28 Mar 2017 10:28:37 -0500”}]}}}

When we use that data in the web hook http request raw content field, say for example like this:

“content”: “{{query_from_rss.data__query__results__item__0__description}}”

The quotes get removed and then because they are not escaped it breaks in messenger. We were able to catch this by doing multiple tests until we finally found that the quotes not escaped were creating a malformed JSON being sent to Facebook send api.

Removing the escaping forward slashes seems like a bug in your form, where you capture the raw Body content in the HTTP request action. Any chance this can get fixed any time soon? And if you have a workaround that would be great too…

Thanks!

(Sarah Palombo) #2

I think we have answered this on email - Hopefully that helped. :+1:

The description containing "Baker’s Dozen\ does break the JSON when making a custom request.

You could use the Text (String) service to Split the text (removing the \ or ") that way you can just output the text
without this character.

Hopefully Dans details have helped you here :slight_smile:

Sarah