Introduction

The HTTP A2P Messaging API allows the user to initiate the sending of SMS messages to the recipient while specifying the desired content.

Once the SMS has been sent to the subscriber the message delivery status will be received to the callback URL which has been configured by your account manager.

Error codes

When sending the message using the /send endpoint the following errors can appear within the error field:

HTTP STATUS 200

statuserror_messagedescription
ACCEPTEDOKThe request has been successfully processed
REJECTEDCLIENT_COUNTRY_FORBIDDENThe country has been forbidden
REJECTEDROUTING_FILTER_INVALID_LENGTHThe "to" number doesn't have the valid length
REJECTEDROUTING_PREFIX_FILTER_INVALID_NUMBERThe "to" number doesn't have the valid prefix
REJECTEDSOURCE_ADDRESS_INVALIDThe "from" source address doesn't have a valid value. Alphanumeric: Minimum 2, maximum: 11. Shortcode: Minimum 3, Maximum 9. Numeric: Minimum 9, Maximum: 15 in length
REJECTEDDESTINATION_ADDRESS_INVALIDThe "to" number doesn't have a valid value. Minimum 9, maximum: 15
REJECTEDOUT_OF_BALANCEThe client is out of balance
REJECTEDGENERAL_ERRORA general error has been encountered

HTTP STATUS 401 Unauthorized

statuserror_messagedescription
REJECTEDCLIENT_DISABLEDThe client is not enabled
REJECTEDPRODUCT_DISABLEDThe product has been disabled
REJECTEDACCOUNT_DISABLEDThe client account has been disabled
REJECTEDCONNECTION_DISABLEDThe client HTTP connection is disabled
REJECTEDIP_NOT_ALLOWEDThe request to the HTTP API has been made from an unauthorized IP
REJECTEDUNAUTHORIZEDThe request was not authorized as the API key is not valid
REJECTEDGENERAL_ERRORA general error has been encountered

Callback request example (DLR - delivery notification)

POST /<callback_url>

{
  "error": "000",
  "from": "18888112345",
  "message_id": "8bd71f49-6f42-4729-bf5e-ecf857747633",
  "status": "DELIVERED",
  "to": "16197012345",
  "type": "DLR"
}

Each request contains the following information:

  • message_id - the id of the message which has been returned following /send request
  • from - the source address the message was sent from
  • to - the destination address which has received the message
  • status- the status of the message
    • DELIVERED - Message has been delivered
    • EXPIRED - Message wasn't delivered within the 48 hour period
    • UNDELIVERABLE - Message wasn't delivered (check the error)
    • UNKNOWN - Message wasn't delivered due to a unknown reason
    • REJECTED - Message was rejected by the supplier (check the error)
  • type- type of the callback, either DLR for delivery notification or MO for mobile originated message
  • error - The error code returned by the supplier (check the table below for possible values)
ECERROR DESCRIPTION
0DELIVERED
1UNKNOWN_SUBSCRIBER
5UNIDENTIFIED_SUBSCRIBER
9ILLEGAL_SUBSCRIBER
11TELESERVICE_NOT_PROVISIONED
13CALL_BARRED
21FACILITY_NOT_SUPPORTED
27ABSENT_SUBSCRIBER
31SUBSCRIBER_BUSY_FOR_MT_SMS
32DELIVERY_FAILURE
34SYSTEM_FAILURE
36UNEXPECTED_DATA_VALUE
37MEMORY_CAPACITY_EXCEEDED
38PREFIX_NOT_RESOLVED
39IMSI_BLACKLISTED
40DEST_ADDRESS_BLACKLISTED
41TIME_OUT
43INVALID_ORIGINATOR_ADDRESS
100GENERAL_ERROR
200EQUIPMENT_PROTOCOL_ERROR
201UNKNOWN_MSC
202CONGESTION_ERROR
203PARAMETER_MISSMATCH
204INITIATING_RELEASE
205POTENTIAL_VERSION_INCOMPATIBILITY
206REMOTE_NODE_NOT_REACHABLE
207MTP_FAILURE
346CLIENT_NETWORK_FORBIDDEN (In a case of MNP being performed)
351INVALID_PREFIX_OR_DESTINATION
4100EXPIRED_ON_FORCE_RETRY (When the time to live has been configured for delivery and it has expired)

Callback request example (MO - mobile originated message)

POST /<callback_url>

{
  "from": "16197012345",
  "message_id": "2d7114a6-bd45-4022-98ab-15d36cc2b9bd",
  "text": "STOP",
  "to": "18888112345",
  "type": "MO"
}

Each request contains the following information:

  • message_id - the id of the mobile originated message
  • from - the mobile number the message has been sent from
  • to - the mobile number which has received the message
  • type- type of the callback, either DLR for delivery notification or MO for mobile originated message
  • text - the text of the message which has been sent from to to number

📘

Our team can configure different callback URL's for both MO (mobile originated) and DLR (delivery notification) payloads

Language
Authorization
Header
Click Try It! to start a request and see the response here!