Send an SMS Message
Last updated
Last updated
This method allows you to send an SMS message. Using TSG Global APIs, you can send outgoing SMS messages from your enabled phone numbers to mobile phones around the globe.
Authentication is done by passing your TSG Global API key via the Authorization header in the format "Authorization: Bearer <api_key>" (using the messaging API key specifically). API credentials can be found here: https://customer-portal.tsgglobal.com/account
POST
https://sms.tsgglobal.world/messages
Sends a new SMS message.
Name | Type | Description |
---|---|---|
The entire multipart message id (top level) and first part id (under parts) will always match.
In most cases, we handle the encoding for you — we’ll efficiently transcode it to either fit ASCII, Latin-1 or UTF-16.
The API supports UTF-8. Characters outside of the Latin-1 set will set the encoding to UCS2 (i.e. UTF-16) You can override the encoding by using the force_encoding
field instead.
Below is a table of all the encodings, however only a few are supported for the API.
Good to know: message scheduling can be specified for up to 2 years in advance. We guarantee up to the minute accuracy.
Messages have limited length and exceeding that length will cause message to split into multiple messages that need to be concatenated at the destination (as per GSM messaging standard).
Since multipart messages need to contain additional information on segment ordering and concatenation rules those segments can carry little less information than single-segment messages.
Each segment is technically another SMS message.
Simple message sent from one number to another using only the required parameters.
A single message was sent to 9999999 and 12342341234.
A 3-part multipart message was sent to 9999999 and 12342341234.
int | Description | Supported By API |
---|---|---|
Encoding | 1 segment max length | Multi segment max length | Max segments |
---|---|---|---|
from*
string
Alphanumeric string representing the sender. Either an E.164 format number or Sender ID.
to*
array(string)
One or more recipient numbers in E.164 format. Recipients will be de-duplicated (the same number will only be sent once).
body*
string
Message contents. UTF8-encoded. If a custom encoding is specified, this should be a base64 encoded representation of the raw data.
encoding
int
Specifies message encoding.
force_encoding
int
Normally the system will try to infer what encoding type is best suited for your message, however you can override it using this field instead
registered_delivery
int
Defaults to off. Set to request a delivery receipt from the carrier. 1-3
(always, on success, on error)
deliver_at
datetime
Specifies a future datetime at which to schedule message delivery. Has to be UTC, e.g. "2017-08-04T08:00:00"
expires_at
datetime
Specifies a future datetime when the message should be expired
0
SMSC Default (GSM 7 bit / GSM 3.38)
Yes
1
IA5 (CCITT T.50)/ASCII (ANSI X3.4)
No
2
Octet unspecified (8-bit binary)
No
3
Latin 1 (ISO-8859-1)
Yes
4
Octet unspecified (8-bit binary)
No
5
JIS (X 0208-1990)
No
6
Cyrllic (ISO-8859-5)
No
7
Latin/Hebrew (ISO-8859-8)
No
8
UCS2/UTF-16 (ISO/IEC-10646)
Yes
9
Pictogram Encoding
No
10
Music Codes (ISO-2022-JP)
No
13
Extended Kanji JIS (X 0212-1990)
No
14
Korean Graphic Character Set (KS C 5601/KS X 1001)
No
0
160
153
6
3
140
134
5
8
70
68
6