Skip to content

Send the SMS

POST
/sms

Send short message data, such as text, destination number and sender identification by sending a POST request and we transfer the message to the destination network.

#!/usr/bin/env bash
curl -X POST https://api.lox24.eu/sms \
-H 'Content-Type: application/json' \
-H 'X-LOX24-AUTH-TOKEN: 1234567:e3f3a759b6677959b6ebfcxxxxxxxxxx' \
-d '{
"sender_id": "My Sender",
"phone": "+49751234567",
"source": 111,
"service_code": "direct",
"text": "Test message",
"delivery_at": 1573724611,
"is_unicode": true,
"callback_data": "123456",
"voice_lang": "DE"
}'

The new sms resource

SMS

object
text
required

The message text can have a length of up to 1530 characters. With a Unicode SMS, the maximum character length is reduced to 670 characters. Internal encoding is UTF-8.

string
sender_id
required

Sender ID or phone number

string
/^(\+?[1-9]\d{0,14}|[a-zA-Z0-9 ]{1,11})$/
phone
required

Recipient (international) number:

  • +491701234567 (E.164)
  • 00491701234567
  • 491701234567
  • 01701234567 (if the account is registered in Germany) will be convert to +491701234567

If the number is not in an E.164 format then the service will convert it based on user’s address. To avoid problems with the converting please use E.164 preferentially.

string
>= 4 characters <= 16 characters /^\+[1-9]\d{1,14}$/
Example
+14155552671
delivery_at
One of:

Scheduled delivery timestamp

integer
source

Message source or origin

integer | null
is_unicode

True if message contains Unicode characters, False otherwise

boolean | null
voice_lang
One of:

Voice message language. Possible values: null (auto-detection) or one of: EN (English), DE (German), FR (French), IT (Italian), ES (Spanish), PL (Polish), NL (Dutch), RO (Romanian), PT (Portuguese), CS (Czech), HU (Hungarian), SV (Swedish), DA (Danish), FI (Finnish), SK (Slovak), HR (Croatian), TR (Turkish), RU (Russian), BG (Bulgarian), UK (Ukrainian).

string | null
Allowed values: EN DE FR IT ES PL NL RO PT CS HU SV DA FI SK HR TR RU BG UK
callback_data

String which will be send back to your endpoint. E.g. it can be usable to pass your system message id.

string | null
<= 36 characters
service_code
One of:

Service or gateway code

Allowed values: direct text2speech text2speech_ssml
is_text_deleted
One of:

True if message text was deleted, False otherwise

boolean
attempts_count_max
One of:

Maximum number of delivery attempts for voice services (text2speech, text2speech_ssml). Allowed values: null, 1, 2, or 3 for text2speech/text2speech_ssml services; must be null for other services.

integer | null
Allowed values: 1 2 3
Examples

Basic SMS message

Example of a simple SMS message with required fields only

{
"text": "Hello! This is a test SMS message.",
"sender_id": "+491701234567",
"phone": "+14155552671"
}

Sms resource created

SMS

object
@id

JSON-LD ID

string
@type

JSON-LD type

string
@context
One of:
string
text

The message text can have a length of up to 1530 characters. With a Unicode SMS, the maximum character length is reduced to 670 characters. Internal encoding is UTF-8.

string
sender_id

Sender ID or phone number

string
/^(\+?[1-9]\d{0,14}|[a-zA-Z0-9 ]{1,11})$/
phone

Recipient (international) number:

  • +491701234567 (E.164)
  • 00491701234567
  • 491701234567
  • 01701234567 (if the account is registered in Germany) will be convert to +491701234567

If the number is not in an E.164 format then the service will convert it based on user’s address. To avoid problems with the converting please use E.164 preferentially.

string
>= 4 characters <= 16 characters /^\+[1-9]\d{1,14}$/
Example
+14155552671
delivery_at

Scheduled delivery timestamp

integer
status_code

Status of the sms. For more info see SMS status codes

integer
Allowed values: 0 100 208 400 410 2000 3000 5000 6000
gateway_sent_at

Timestamp when message was sent to the mobile network provider

integer
source

Message source or origin

integer | null
dlr_code
integer
Allowed values: 0 1 2 4 8 16
Example
1
ip

IP address of the host which sent request

string format: ipv4
Example
192.168.1.1
created_at

Timestamp when the entity was added to the system by the user

integer
is_unicode

True if message contains Unicode characters, False otherwise

boolean | null
uuid

Unique entity UUID

string
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
iso2

Country code

string
>= 2 characters <= 2 characters /^[A-Z]{2}$/
voice_lang

Voice message language. Possible values: null (auto-detection) or one of: EN (English), DE (German), FR (French), IT (Italian), ES (Spanish), PL (Polish), NL (Dutch), RO (Romanian), PT (Portuguese), CS (Czech), HU (Hungarian), SV (Swedish), DA (Danish), FI (Finnish), SK (Slovak), HR (Croatian), TR (Turkish), RU (Russian), BG (Bulgarian), UK (Ukrainian).

string | null
Allowed values: EN DE FR IT ES PL NL RO PT CS HU SV DA FI SK HR TR RU BG UK
parts_count

Count of the SMS parts (concatenated messages)

integer
>= 1
chars_count

Count of chars in the message text

integer | null
callback_data

String which will be send back to your endpoint. E.g. it can be usable to pass your system message id.

string | null
<= 36 characters
bulk_id

Bulk ID

null | string
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
key_id

API key identifier

integer
>= 1
service_code

Service or gateway code

Allowed values: direct text2speech text2speech_ssml
is_text_deleted

True if message text was deleted, False otherwise

boolean
price

Price

number
is_sent

True - SMS was sent, False - SMS wasn’t sent yet

boolean
requests

Link to all requests by a SMS list

string | null
clicks

Link to count of request by a short link

string | null
attempts_count_max

Maximum number of delivery attempts for voice services (text2speech, text2speech_ssml). Allowed values: null, 1, 2, or 3 for text2speech/text2speech_ssml services; must be null for other services.

integer | null
Allowed values: 1 2 3
Examples

Basic sms Message response

API response for a successfully request with minimum parameters

{
"@context": "/contexts/sms",
"@id": "/sms/11111111-2222-3333-4444-555555555555",
"@type": "sms",
"text": "Hello! This is a test SMS message.",
"sender_id": "+19388888025",
"phone": "+14155552671",
"delivery_at": 0,
"status_code": 0,
"gateway_sent_at": 0,
"source": 0,
"dlr_code": 0,
"ip": "139.59.136.251",
"created_at": 1755868416,
"is_unicode": false,
"uuid": "11111111-2222-3333-4444-555555555555",
"iso2": "US",
"voice_lang": null,
"parts_count": 1,
"chars_count": 34,
"callback_data": null,
"bulk_id": null,
"key_id": 8291,
"service_code": "direct",
"is_text_deleted": false,
"price": 0.056,
"is_sent": false,
"requests": "/sms/11111111-2222-3333-4444-555555555555/requests",
"clicks": "/sms/11111111-2222-3333-4444-555555555555/clicks"
}

Invalid input

Client ID or API key isn’t active or invalid!

There are not enough funds on your account!

Account isn’t activated. Please wait or contact to support!

The request was well-formed but was unable to be followed due to semantic errors

IP address was temporary blocked, because during short time from it was sent many request with invalid credentials. Please wait and try later.