EZI API

The EZI API provides two authentication methods: HTTP and REST. Both APIs allow you to send SMS messages and retrieve message information.


HTTP API

Authentication

Our HTTP API uses an API key for authentication. Your account’s API key can be found in the Settings section when you have logged into the web platform.

When using the HTTP API, the API key must be passed as a querystring variable: https://new.eziapi.com/sms?key={APIKEY} ...

Endpoint and Response Format

The current API endpoint is: https://new.eziapi.com

All responses are returned in JSON format.

Send an SMS

To send an SMS message using the HTTP API, submit a GET request:

Request

Method URL
GET /sms
Parameter Description Type Required
key API Key String Yes
recipient International formatted MSISDN Integer Yes
content Body of the message to send String Yes
reply Flag if the message is a reply Boolean No
reply_to ID of the message being replied to Integer No
mask Alphanumeric mask (11 chars max) — if supported String No
premium Use the premium route — if supported Boolean No

Response

On Success:

Status Reason Response
200 OK
{
    "id": integer($int64):message-id,
    "recipient": integer:mobile-number,
    "encoding": str:encoding-type,
    "units": integer:unit-count,
    "status": str:message-status
}
Parameter Description
id Message ID (64-bit integer)
recipient The recipient’s phone number
encoding The encoding used for the message
units Number of message units used
status Current status of the message

REST API

Authentication

When using the REST API, the API key should be passed as a header in the request.

Endpoint and Response Format

The current API endpoint is: https://new.eziapi.com

All responses are returned in JSON format.

Send an SMS

To send an SMS message using the REST API, submit a POST request:

Request

Method URL
POST /v3/sms
Parameter Description Type Required
key API key (Header) String Yes
recipient International formatted MSISDN of the recipient Integer Yes (if contact_id not specified)
contact_id ID of the contact to send a message to Integer Yes (if recipient not specified)
template_id ID of the template to use Integer Yes (if content not supplied)
content Message content String Yes (if template_id not supplied)
reply Flag for if the message is a reply Boolean No (Default: FALSE)
reply_to ID of the SMS this is a reply to Integer Yes (if reply is TRUE)
mask Alphanumeric mask (11 chars max) String No
premium Use the premium route Boolean No (Default: FALSE)

Response

On Success:

Status Reason Response
200 OK
{
    "id": integer($int64):message-id,
    "recipient": integer:mobile-number,
    "encoding": str:encoding-type,
    "units": integer:unit-count,
    "status": str:message-status
}
Response Parameter Description
id Message ID (64-bit integer)
recipient The recipient’s phone number
encoding The encoding used for the message
units Number of message units used
status Current status of the message

Retrieve Messages

To retrieve messages with optional filtering parameters using the REST API, submit a GET request:

Request

Method URL
GET /v3/sms
Parameter Description Type Required
key API key (Header) String Yes
limit Number of messages to return Integer No (Default: 20)
offset Pagination offset Integer No (Default: 0)
direction Filter by message direction String No
status Message status filter String No
min_date Minimum date filter (UNIX timestamp) Integer No
max_date Maximum date filter (UNIX timestamp) Integer No
order Sort order (“ASC” or “DESC”) String No

Example GET https://new.eziapi.com/v3/sms?limit=20&offset=0

Note: The API key should be included in the request header, not as a query parameter.

Response

Status Reason Response
200 OK
{
    "results": [
        {
            "id": integer($int64):message-id,
            "direction": str:direction,
            "source": str:source-identifier,
            "msisdn": integer:mobile-number,
            "country": str:country-code,
            "content": str:message-content,
            "units": integer:unit-count,
            "encoding": str:encoding-type,
            "timestamp": integer:unix-timestamp,
            "last_updated": integer:unix-timestamp,
            "status": str:message-status,
            "message_id": integer($int64):message-id,
            "keyword_id": integer:keyword-id,
            "contact_id": integer:contact-id,
            "parent_id": integer:parent-message-id,
            "optout": boolean:optout-flag
        }
        // Additional messages...
    ],
    "limit": integer:limit,
    "offset": integer:offset,
    "total": integer:total-count
}
Message Object Structure

Each message in the results array contains the following fields:

Parameter Type Description
id Integer Internal message ID (64-bit integer)
direction String Message direction: “MO” (incoming) or “MT” (outgoing)
source String Source identifier (mask or number)
msisdn Integer Mobile number (MSISDN)
country String Country code (may be empty)
content String Message content/text
units Integer Number of message units
encoding String Message encoding (e.g., “UTF-8”)
timestamp Integer Message creation time as UNIX timestamp
last_updated Integer Last update time as UNIX timestamp
status String Message status (e.g., “received” for MO, “sent” for MT)
message_id Integer Reference message ID
keyword_id Integer Legacy field - always returns 0 (can be ignored)
contact_id Integer Legacy field - always returns 0 (can be ignored)
parent_id Integer Parent message ID (for replies)
optout Boolean Whether the message is an opt-out message

Callbacks

MO Callback

When a mobile-originated (MO) message is received by our platform, we can forward it to your system via a callback URL that you configure. The callback will be sent as an HTTP GET request to your specified endpoint.

You can include placeholders in your callback URL that will be replaced with actual message data:

Parameter Description
%%messageid%% The ID of the received message
%%content%% The content of the message
%%source%% The sender’s phone number
%%replyto%% The message ID this is a reply to (if applicable)
%%timestamp%% The timestamp when the message was received

Binary Message Handling For binary messages (8-bit), the content will be base64 encoded and an additional parameter encoding=base64 will be included in the callback URL.

DLR Callback

When the status of a message changes (e.g., from “sent” to “delivered”), we can notify your system via a Delivery Receipt (DLR) callback. The callback will be sent as an HTTP POST request to your specified endpoint.

Callback Format

{
    "id": integer($int64):message-id,
    "status": str:message-status,
    "timestamp": integer:unix-timestamp
}

Note: You will need to contact our support team to configure callback URLs for your account.

Message Status Codes

The following are the status codes that may be returned for messages:

Status Description
queued Message has been queued for sending
sent Message has been sent by the carrier transport
delivered Message has been delivered to the recipient’s device
received Message has been received (for MO messages)
rejected The carrier rejected the message
failed Message delivery has failed
expired The carrier was unable to deliver the message in a specified amount of time

Help

Having trouble integrating with our EZI API? Contact our support team and we’ll help you sort it out support@ezitxt.com.