SAEM company logo

API SMS

This API allows you to send SMS messages in bulk and individually.

SMS Sending API Usage Guide

Abbreviations

AbbreviationDescription
PARQUETFile format designed to store large amounts of data in an organized and efficient way.
PDUProtocol Data Unit, which represents the number of fragments an SMS is split into for delivery.
UUIDUniversally Unique Identifier (randomly generated code) used for msg_id and request_id.

Introduction

The SMS Sending API allows you to perform single and bulk text message deliveries using JSON or Parquet formats.

Through this guide you will learn how to authenticate, which services are available and which structures must be used to send messages correctly, which methods are available and which formats must be used to make requests.

1. Authentication and Security

Before using the Bulk Sending API, you must have a secure access key ("api key"). This key is delivered directly by the Saem Colombia team and must be included in every request within the x-auth header.

Without this authentication, the system will reject the request.

In addition to the api key, the x-prefix header must be included, indicating the country code, in all requests.

Example (headers):

KeyValue
x-authapi-key-00000000000000000000000000000000000000
x-prefix57

Services Available in the SMS API

Input Parameters

FieldDescription
fromIdentifier of the sender authorized to send messages.
numbersList of messages to send. Each object must include to, content and optionally msg_id.
msg_idUnique message ID. If not sent, it is generated automatically.
toRecipient's mobile number.
contentMessage text including the shortname.
flashDefines whether the SMS will be displayed immediately in a pop-up window (yes or no). This field is mandatory for all services.
unique-numbersIf required, use this parameter to validate and reject duplicate numbers in the delivery. Accepts yes or no. Otherwise, it does not need to be included.
x-prefixCountry code, must be sent as a header.
x-authAuthentication token, must be sent as a header.

2. Single Sending

  • URL: https://apisms.saem.tel/v3/send
  • Method: GET
  • Headers: x-auth: api-key-XXX000X00000, x-prefix: 57 Params example (query string):
KeyValue
to573999999999
contentPrueba oficial SMS API V3 claro
fromsaemcolombia
flashno

Full request example:

GET https://apisms.saem.tel/v3/send?to=573999999999&content=Prueba oficial SMS API V3 claro&from=saemcolombia&flash=no

💡 IMPORTANT For all our services in JSON format, a maximum of 200,000 records can be uploaded. If a higher amount is sent, the system will reject the request with the error: SMS_008.

3. Bulk Sending — JSON Format

  • URL: https://apisms.saem.tel/v3/send
  • Method: POST
  • Headers: x-auth: api-key-XXX000X00000, x-prefix: 57 Body example:
{
  "from": "SaemColombia",
  "coding": 0,
  "dlr": "no",
  "dlr-url": "",
  "dlr-level": "",
  "dlr-method": "",
  "flash": "no",
  "unique-numbers": "yes",
  "numbers": [
    { "to": "3000000000", "content": "Hola Saem, este es tu mensaje de prueba oficial" },
    { "to": "3123457891", "content": "Hola Saem, este es tu mensaje de prueba oficial" },
    { "to": "3999999999", "content": "Hola Saem, este es tu mensaje de prueba oficial" },
    { "to": "3999999999", "content": "Hola Saem, este es tu mensaje de prueba oficial" },
    { "to": "3999999999", "content": "Hola Saem, este es tu mensaje de prueba oficial" }
  ]
}

For the following format, keep in mind that the request body must be sent as form-data, including the .parquet file and the other required parameters.

💡 Recommendation: We suggest using the .Parquet format instead of JSON files, since it allows a much faster upload, reduces the file size and improves the overall performance of the process.

For this format, a maximum of 500,000 records can be uploaded. If a higher amount is sent, the system will reject the request with the error SMS_008.

4. Bulk Sending — Parquet Format

  • URL: https://apisms.saem.tel/v3/send/parquet
  • Method: POST
  • Headers: x-auth: api-key-XXX000X00000, x-prefix: 57 Body example (form-data):
KeyTypeValue
fileFilesms_prueba.parquet
fromTextsaemcolombia
codingText0
dlrTextno
dlr-urlText(empty)
dlr-levelText1
dlr-methodTextPOST
flashText(empty)

5. Common Errors and Responses

CodeStatusDescription
USER_NOT_FOUND404The user is not valid.
USER_INACTIVE401The user is inactive or does not have permissions to perform the action.
AUTH.TOKEN_MISSING400The authentication token is missing.
API_KEY_NOT_FOUND400The API key was not found or has been revoked.
COUNTRY_001400No country associated with the prefix was found.
SMS_002402Insufficient credits for prepaid plan users.
SMS_008400The number of records sent exceeds the allowed limit.
SMS_009400The Parquet file sent is not valid or does not meet the expected format.
DUPLICATED_MSG_ID400One or more msg_id identifiers already exist in a previous campaign.
FORBIDDEN_TERMS400The content contains terms that are not allowed.
SHORTNAME_INACTIVE400The shortname is not active for the user.
SHORTNAME_NOT_FOUND400The message does not contain the mandatory shortname.
CONTENT_TOO_LONG400The content exceeds the length limit allowed for an SMS.

Output Parameters

FieldDescription
request_idUnique ID assigned to the bulk campaign.
total_creditsTotal credits consumed by the delivery.
recordsTotal messages processed in the campaign.
total_pdu_countTotal PDUs generated across all messages.

PARQUET

Columnar file format recommended for bulk uploads of phone numbers and campaign parameters.

PDU

Protocol Data Unit. Data unit that represents the fragments into which an SMS is split for delivery.

UUID

Universally unique identifier used for msg_id and request_id in the API.

SUBSERVICE

Campaign type: standard (pre-recorded audio) or custom (text-to-speech).

AUDIOID

Identifier of the multimedia resource associated with a pre-recorded audio in STANDARD mode.

VOICE

Voice used in CUSTOM campaigns to convert text into audio. Voices such as "Juan" or "Maria" can be used.

MAILBOX

Indicates whether a voicemail message is left when the recipient does not answer.

Submit a PQRSF