Docs

Send a message

POST https://api.telrioz.com/api/v1/messages

One text to 1 to 1000 numbers, through a Gateway. It sends SMS or WhatsApp Generic, whichever the Gateway's Channel is. A 200 lists each number with its message ID, or the reason it was turned away: read rejected[], because a 200 does not mean every number went out. Then follow each message with GET /messages/{id} or a webhook.

Authentication

Send your key in the header Authorization: Bearer YOUR_API_KEY. See Authentication.

Request body (JSON)
NameTypeDescription
torequiredstring or string[]

One number, or a list of 1 to 1000 numbers. Write it as 6281234567890, +62 812-3456-7890 or 081234567890: spaces, dashes and brackets are ignored, a leading + is dropped, a leading 0 becomes 62, and the result must be 8 to 15 digits. A number given twice is sent once. A number we cannot read comes back in rejected[] as invalid_number, and the others still go out. The numbers times the text's parts may be at most 1000 segments.

textrequiredstring

The message. One part holds 160 GSM-7 characters; a character from the extension table (€ [ ] { } ^ ~ | \ and form feed) counts as 2. A text with any other character, such as an emoji or a non-Latin letter, is sent as UCS-2: 70 characters in one part, and an emoji counts as 2. A longer text is split into parts of 153 (GSM-7) or 67 (UCS-2) characters, and each part is charged as one segment. At most 10 parts.

fromstring

The Sender ID: 1 to 11 letters, digits, spaces or the characters . & -, or up to 15 digits. Anything else answers 400, on every Channel. Leave it out to send from the Gateway's Sender ID; it is required when the Gateway has none and its Channel takes one, and then it must be approved for the number's operator. A Channel that takes no Sender ID ignores a valid one: the upstream sends from its own number.

gatewaystring or integer

The ID of the Gateway to send through, as the dashboard shows it. Leave it out to send through your Default Gateway. It cannot be an OTP Gateway: those send through POST /otp. With a Gateway key, leave it out or give that Gateway's ID. The Gateway sets the Use case, Channel, Route and price, and must be active: a Gateway that is paused or deleted, named or behind a Gateway key, answers 400 invalid_request, gateway: unknown or paused.

Request examples

one: One number
{
  "to": "6281234567890",
  "text": "Your order has shipped."
}
many: Several numbers, through a named Gateway
{
  "to": [
    "6281234567890",
    "081298765432"
  ],
  "text": "Your order has shipped.",
  "from": "ACME",
  "gateway": "12"
}

Limits

See Limits.

Responses