SMS
Unicode
Please note that there are a few limitations to using unicode encoded messages:
- Unicode messages can contain up to 70 characters. In the case of multipart messages, this becomes 67 characters per part.
- You will need to POST the XML or JSON file. A HTTP GET request cannot handle the Unicode characters
- Another note is that not all operators in the world are able to handle Unicode messages, so you will need to test for which operators it works. If you want to have support with this our TEXTER solution might be a solution for you.
Auto detect encoding
It is possible to let our gateway detect the encoding for you by including the type: auto
setting. In case it detects characters that are not part of the GSM character set, the message will be delivered as Unicode. Any existing DCS value will be ignored. If the message contains more than 70 characters in Unicode format it will be split into a multipart message. You can limit the number of parts by setting the maximum number of message parts (see also the section on Multipart below).
{
"messages": {
"authentication": {
"producttoken": "00000000-0000-0000-0000-000000000000"
},
"msg": [ {
"allowedChannels": ["SMS"],
"from": "SenderName",
"to": [{
"number": "00447911123456"
}],
"minimumNumberOfMessageParts": 1,
"maximumNumberOfMessageParts": 8,
"body": {
"type": "auto",
"content": "Κείμενο διαθέσιμο σε όλες τις γλώσσες"
},
"reference": "your_reference"
}
]
}
}
Custom DCS
By default our gateway interprets SMS messages as if sent with the standard 7 bit GSM encoding. You can use the DCS (data coding scheme) parameter to indicate the type of message you are sending. If you set DCS to '0' or do not include the parameter, the messages uses standard GSM encoding. If you want to send messages using e.g. Arabic, Cyrillic of Greek characters you will need to use the unicode UCS2 encoding. To set your message up for unicode messaging include <DCS>8</DCS>
in your <MSG>
-element, or if you're using JSON "dcs": 8
in a msg
object. See the examples below.
View the Unicode paragraph for more information.
{
"messages": {
"authentication": {
"producttoken": "00000000-0000-0000-0000-000000000000"
},
"msg": [ {
"allowedChannels": ["SMS"],
"from": "SenderName",
"to": [{
"number": "00447911123456"
}],
"dcs": 8,
"body": {
"content": "Κείμενο διαθέσιμο σε όλες τις γλώσσες"
},
"reference": "your_reference"
}
]
}
}
Multipart
When your message is longer than 160 characters (or 70 when it contains unicode characters), we call such a message a multipart or concatenated message. The gateway will first check if an SMS is bigger than 160 (or 70) characters, and if so the message will be cut into multiple parts.
Please note that there are a few limitations to using multipart messages:
- Each message part can only contain up to 153 or 67 characters. (rest of the message is used to match the separate parts in the right order together again)
- The SMS standard theoretically permits up to 255 message parts (which could mean you would send messages of 153 times 255 = 39.000 characters). In practice you should try to limit your message to 8 message parts – thus 153 times 8 = 1.224 characters or 67 times 8 == 536 for unicode messages.
- If you use any character outside the GSM encoding the multipart messaging will use Unicode encoding for each of the parts and thus each part will be a maximum of 67 characters.
- When sending multi-part messages, pricing is done per message part of 153/67 characters, hence sending multipart message can have impact on your budget.
- Another note is that not all operators in the world are able to handle multipart messages, so you will need to test for which operators it works. If you want to have support with this our TEXTER solution might be a solution for you. More information can be found in the TEXTER solution product page.
- Newer channels like RCS, WhatsApp and Apple Messages for Business allow for much longer messages. When you want to send large messages it might be worthwhile to investigate these alternative channels.
Example
{
"messages": {
"authentication": {
"producttoken": "00000000-0000-0000-0000-000000000000"
},
"msg": [ {
"allowedChannels": ["SMS"],
"from": "SenderName",
"to": [{
"number": "00447911123456"
}],
"minimumNumberOfMessageParts": 1,
"maximumNumberOfMessageParts": 8,
"body": {
"content": "Using these settings we can send SMS messages that contain more than 160 characters as if it is one message. Please do note that this limits the length of one message to 153 characters."
},
"reference": "your_reference"
}
]
}
}
Updated 5 months ago