How do I add a line break in my SMS message?

Updated 2 years ago

API

You can use the official REST API documentation for ClickSend and search Send SMS, find the code sample and change and run it according to your data.

To add a new line in the message body of outgoing SMS, there are a few options below if sending via the API.

\n Character

  • If you're using a JSON request body, you can use "\n"
    e.g. "body" : "Here is my first line\nhere is my second line",
  • If that doesn't work, try "\r\n"
    e.g. "body" : "Here is my first line\r\nhere is my second line",

<br> HTML Tag

Use "<br>" in the message body

e.g. "Here is my first line<br>here is my second line"

%0a New Line Character

Encode a new line as %0a.

For example, you could send a message like the following:

"Body=Here+is+my+first+line%0aHere+is+my+second+line"

Line Break Character

Use a new line in your body string e.g. 

"Body=Here+is+my+first+line

Here+is+my+second+line"

Line breaks/carriage returns count as 2 characters.


How Did We Do?


Powered by HelpDocs (opens in a new tab)