Encodings
data_coding
0x00 GSM 7-bit (default), 0x08 UCS-2. With 0x00 we read the text as GSM 7-bit. Use 0x08 for text with characters outside GSM 7-bit, such as emoji or Chinese.
| Encoding | data_coding | One part | Each part of a long text |
|---|---|---|---|
| GSM 7-bit | 0x00 | 160 characters | 153 characters |
| UCS-2 | 0x08 | 70 characters | 67 characters |
- GSM 7-bit: write one character per byte (unpacked septets), not packed. A character from the extension table,
€ [ ] { } ^ ~ | \and form feed, is an escape byte0x1Band one more, so it counts as 2. - UCS-2: two bytes per character, big-endian. Use it for any character outside GSM 7-bit, such as an emoji or a non-Latin letter. An emoji takes two UCS-2 characters.
The sizes for a long text assume the 6-byte UDH with an 8-bit reference, below. The 16-bit reference takes one byte more: 152 GSM 7-bit or 66 UCS-2 characters a part.
Long messages
Send each part as its own submit_sm. A UDH in the text carries a reference, a total and a part number (8-bit or 16-bit reference), or you can use the sar_* TLVs. Each part is accepted, and charged, as its own segment. You can also put the long text in the message_payload TLV.
- UDH: set
esm_classto0x40and startshort_messagewith the UDH:05 00 03+ reference + total + part number (8-bit reference), or06 08 04+ 2-byte reference + total + part number (16-bit reference). - SAR TLVs:
sar_msg_ref_num,sar_total_segmentsandsar_segment_seqnumon each part, withesm_class0x00.
Use one reference for all the parts of one text, and a new one for the next text. Each part gets its own message_id and, if you ask for receipts, its own receipt. In the webhook, every part has the same multipart_id, with part and parts.
Over the REST API, Telrioz splits the text for you, up to 10 parts: see Send a message.