Concatenated SMS

Single SMS messages have a limit of 160 characters so for longer SMS messages, a strategy of concatenation should be employed. Concatenation allows sending multiple SMS messages which are then joined as a single long SMS on the destination device.

Specifying that SMS messages should be concatenated via the API is done using the udh parameter which stands for User Data Header.

User Data Header (UDH)

User Data Headers (UDH) are a short strings of bytes at the start of an SMS used to indicate the handling of the content of an SMS. Specifying that messages should be concatenated and in what order may be done in these headers.

The following two API calls would concatenate two SMS messages into one on the destination device:

POST
/api/v1/endpoint/:endpoint_id/sms
1curl -X POST https://cdn.emnify.net/api/v1/endpoint/endpoint_id/sms \
2 -H "Authorization: Bearer <token>" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "payload": "First part of the SMS...",
6 "udh": "050003CC0201"
7}'
POST
/api/v1/endpoint/:endpoint_id/sms
1curl -X POST https://cdn.emnify.net/api/v1/endpoint/endpoint_id/sms \
2 -H "Authorization: Bearer <token>" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "payload": "Second part of the SMS...",
6 "udh": "050003CC0202"
7}'

First SMS UDH value:

105 00 03 CC 02 01

Second SMS UDH value:

105 00 03 CC 02 02

These UDH values are read as follows:

105 UDHL - The following five bytes should be read as the header
200 IEI - 00 or 08 values indicate a concatenated message
303 IEDL - The following 3 bytes are the data for this IE
4CC Reference - Each part of a concatenated message must have the same reference
502 The number of parts this concatenated message is comprised of.
601/02 The order that this message should appear, in this case either the first or second SMS.

2 byte IEI

For an IEI of 08, the SMS reference number uses a 2 byte (16 bit) value.

First SMS UDH value:

106 08 04 F4 2E 02 01

Second SMS UDH Value:

106 08 04 F4 2E 02 02

These UDH values are read as follows:

106 UDHL - The following six bytes should be read as the header
208 IEI - 08 indicates a concatenated message with 16-bit reference
304 IEDL - The following 4 bytes are the data for this IE
4F42E Reference - Each part of this concatenated message must have the same reference, this time in 16-bit
502 The number of parts this concatenated message is comprised of.
601/02 The order that this message should appear, in this case either the first or second SMS.