How to the a newline character \n through a webhook call to Twilio

I'm using Twilio to send SMS - works just fine. But I need to include a newline character. If I send just a \n as part of the particle.publish, it fails, probably because the \n fouls up the publish. For example I send:

{"Body": "Alarm: NORMAL \n1-Front Door-Normal\n-Garage Door-Normal","To": "6095551212"}

How can I send a \n character so it gets over to Twilio as part of the message string?

Thanks.

@Iras, you need to "double escape" the newline character using \\n.

1 Like

PERFECT! Thanks!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.