Pular para o conteúdo

Simulate sending an SMS (for testing)

POST
/sms/dryrun

This endpoint doesn’t send any SMS but emulates the proccess and response. This can be used to get the SMS price or test the API during the integration process. The property uuid will be always equal to 11111111-2222-3333-4444-55555555555. No data will be saved at LOX24, therefore you can’t extract any SMS info by GET /sms/{id}. DLR report are send back in same way as per real SMS, if DLR url/email was set-up before, but with statuscode 0.

The new sms resource

Media type application/json

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
>= 1 characters
sender_id
required

Sender-ID of the message. Can be a number (up to 15 digits) or a text (up to 11 character). In case of a number please use preferentially E.164 phone number format. A sender of text may contain spaces but no other special characters. Please note that some countries do not support own sender IDs or do require pre-registration. Our system automatically tries to detect whether a sender ID is a text or a phone number. Avoid special characters in a number and enter it the same way as it would be dialed on a phone.

Para mensagens de voz (text2speech, text2speech_ssml): se sender_id não estiver em conformidade com o formato E.164 (por exemplo, sem o prefixo +, contendo caracteres não numéricos), a mensagem será enviada a partir do número padrão do sistema +493075435114. Alguns provedores de telefonia downstream podem substituir ou não respeitar o número de remetente definido pelo usuário — o identificador de chamada real apresentado ao destinatário depende das capacidades do provedor.

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
>= 7 characters <= 16 characters /^\+[1-9]\d{1,14}$/
delivery_at
One of:

Timestamp de entrega programada

integer
source

Fonte ou origem da mensagem

integer | null
is_unicode

True se a mensagem contém caracteres Unicode, False caso contrário

boolean | null
voice_lang

Idioma da mensagem de voz. Valores possíveis: null (detecção automática) ou um dos seguintes: EN (inglês), DE (alemão), FR (francês), IT (italiano), ES (espanhol), PL (polaco), NL (neerlandês), RO (romeno), PT (português), CS (checo), HU (húngaro), SV (sueco), DA (dinamarquês), FI (finlandês), SK (eslovaco), HR (croata), TR (turco), RU (russo), BG (búlgaro), UK (ucraniano).

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:

Código de serviço ou gateway

Allowed values: direct text2speech text2speech_ssml
is_text_deleted
One of:

True se o texto da mensagem foi excluído, False caso contrário

boolean
attempts_count_max

Número máximo de tentativas de entrega para serviços de voz (text2speech, text2speech_ssml). Valores permitidos: null, 1, 2 ou 3 para os serviços text2speech/text2speech_ssml; deve ser nulo para os restantes serviços.

integer | null
Allowed values: 1 2 3
Examples

Mensagem SMS básica

Exemplo de uma mensagem SMS simples com apenas campos obrigatórios

{
"text": "Olá! Esta é uma mensagem SMS de teste.",
"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 of the message. Can be a number (up to 15 digits) or a text (up to 11 character). In case of a number please use preferentially E.164 phone number format. A sender of text may contain spaces but no other special characters. Please note that some countries do not support own sender IDs or do require pre-registration. Our system automatically tries to detect whether a sender ID is a text or a phone number. Avoid special characters in a number and enter it the same way as it would be dialed on a phone.

Para mensagens de voz (text2speech, text2speech_ssml): se sender_id não estiver em conformidade com o formato E.164 (por exemplo, sem o prefixo +, contendo caracteres não numéricos), a mensagem será enviada a partir do número padrão do sistema +493075435114. Alguns provedores de telefonia downstream podem substituir ou não respeitar o número de remetente definido pelo usuário — o identificador de chamada real apresentado ao destinatário depende das capacidades do provedor.

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
>= 7 characters <= 16 characters /^\+[1-9]\d{1,14}$/
delivery_at

Timestamp de entrega programada

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

Fonte ou origem da mensagem

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

IP address of the host which sent request

string format: ipv4
created_at

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

integer
is_unicode

True se a mensagem contém caracteres Unicode, False caso contrário

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

Código do país

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

Idioma da mensagem de voz. Valores possíveis: null (detecção automática) ou um dos seguintes: EN (inglês), DE (alemão), FR (francês), IT (italiano), ES (espanhol), PL (polaco), NL (neerlandês), RO (romeno), PT (português), CS (checo), HU (húngaro), SV (sueco), DA (dinamarquês), FI (finlandês), SK (eslovaco), HR (croata), TR (turco), RU (russo), BG (búlgaro), UK (ucraniano).

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

Identificador da chave API

integer
>= 1
service_code

Código de serviço ou gateway

Allowed values: direct text2speech text2speech_ssml
is_text_deleted

True se o texto da mensagem foi excluído, False caso contrário

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

Número máximo de tentativas de entrega para serviços de voz (text2speech, text2speech_ssml). Valores permitidos: null, 1, 2 ou 3 para os serviços text2speech/text2speech_ssml; deve ser nulo para os restantes serviços.

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": "10.1.1.1",
"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!

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

O endereço IP foi bloqueado temporariamente, pois durante um curto período de tempo foram enviadas várias solicitações com credenciais inválidas. Aguarde e tente mais tarde.

Code Samples

#!/usr/bin/env bash
curl -X POST https://api.lox24.eu/sms/dryrun \
-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"
}'