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:

{ 
 "payload": "First part of the SMS...",  
 "udh": "050003CC0201" 
}

POST /api/v1/endpoint/{endpoint_id}/sms:

{ 
 "payload": "Second part of the SMS",  
 "udh": "050003CC0202" 
}

First SMS UDH value:

05 00 03 CC 02 01 

Second SMS UDH value:

05 00 03 CC 02 02

These UDH values are read as follows:

05     UDHL - The following five bytes should be read as the header
00     IEI  - 00 or 08 values indicate a concatenated message
03     IEDL - The following 3 bytes are the data for this IE
CC     Reference - Each part of a concatenated message must have the same reference
02     The number of parts this concatenated message is comprised of.
01/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:

06 08 04 F4 2E 02 01  

Second SMS UDH Value:

06 08 04 F4 2E 02 02

These UDH values are read as follows:

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