Skip to content

Instantly share code, notes, and snippets.

@wesgibbs
Last active August 19, 2016 20:15
Show Gist options
  • Save wesgibbs/61afa98253d2136832dd7a0331a1fd08 to your computer and use it in GitHub Desktop.
Save wesgibbs/61afa98253d2136832dd7a0331a1fd08 to your computer and use it in GitHub Desktop.
Documentation for troubleshooting the appearance of newline characters in the Help Scout message body
This is a sample payload we post to /conversations.json
"{\"customer\":{\"email\":\"1ANSV69@blackhole.czops.net\"},\"mailbox\":{\"id\":45263},\"reload\":true,\"subject\":\"Test42\",\"tags\":[\"app\"],\"threads\":[{\"body\":\"Test42\\u003Cbr /\\u003E\\u003Cbr /\\u003EWith\\u003Cbr /\\u003E\\u003Cbr /\\u003ELine\\u003Cbr /\\u003EBreaks.\\u003Cbr/\\u003E\\u003Cbr/\\u003E\\u003Cbr/\\u003E-----\\u003Cbr/\\u003ECZDATA\\u003Cbr/\\u003E{\\\"conversation_id\\\":\\\"3TJHJQ\\\",\\\"message_id\\\":\\\"10QHPC5\\\"}\",\"createdBy\":{\"email\":\"1T88N6M@blackhole.czops.net\",\"type\":\"customer\"},\"type\":\"customer\"}]}"
When I curl that conversation
curl -u APIKEY:X https://api.helpscout.net/v:X https://api.helpscout.net/v1/conversations/240823781.json
the "body" returned has newline characters inserted before each HTML break tag. Prior to Aug 18 message bodies did not have those newline charcters.
"body":"Test42\n<br>\n<br>With\n<br>\n<br>Line\n<br>Breaks.\n<br>\n<br>\n<br>-----\n<br>CZDATA\n<br>{\"conversation_id\":\"3TJHJQ\",\"message_id\":\"10QHPC5\"}"
@wesgibbs
Copy link
Author

This is to help troubleshoot a change in the behavior of message bodies that showed up for us 2016-08-18 12:10:45.276619 UTC (which is Thursday, Aug 18 8:10 AM ET).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment