Send templated message

Send an SMS using a template

post

Provide the destination number to, and optional callback_url, plus all template parameters under params as additional JSON fields (all string values). Check the Templates API for fetching the template id.

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)

EC
ERROR DESCRIPTION

0

DELIVERED

1

UNKNOWN_SUBSCRIBER

5

UNIDENTIFIED_SUBSCRIBER

9

ILLEGAL_SUBSCRIBER

11

TELESERVICE_NOT_PROVISIONED

13

CALL_BARRED

21

FACILITY_NOT_SUPPORTED

27

ABSENT_SUBSCRIBER

31

SUBSCRIBER_BUSY_FOR_MT_SMS

32

DELIVERY_FAILURE

34

SYSTEM_FAILURE

36

UNEXPECTED_DATA_VALUE

37

MEMORY_CAPACITY_EXCEEDED

38

PREFIX_NOT_RESOLVED

39

IMSI_BLACKLISTED

40

DEST_ADDRESS_BLACKLISTED

41

TIME_OUT

43

INVALID_ORIGINATOR_ADDRESS

100

GENERAL_ERROR

200

EQUIPMENT_PROTOCOL_ERROR

201

UNKNOWN_MSC

202

CONGESTION_ERROR

203

PARAMETER_MISSMATCH

204

INITIATING_RELEASE

205

POTENTIAL_VERSION_INCOMPATIBILITY

206

REMOTE_NODE_NOT_REACHABLE

207

MTP_FAILURE

346

CLIENT_NETWORK_FORBIDDEN (In a case of MNP being performed)

351

INVALID_PREFIX_OR_DESTINATION

4100

EXPIRED_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>

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

Authorizations
X-API-KEYstringRequired

API key header.

Path parameters
idstring · uuidRequired

Template id

Body
tostringOptional

Destination MSISDN in international format (e.g., 44...)

callback_urlstring · uri | nullableOptional
Responses
chevron-right
200

Accepted or rejected by business validation

application/json
post
/v1.0/sms/template/{id}/send

Last updated