Skip to navigation

Quickstart

Send your first message with the Esendex API
1

Get your API key

Every request is authenticated with an API key sent in the X-API-Key header. See Authentication for details.

2

Send a message

Call Send message with the recipient’s number in international (MSISDN) format and the message text.

curl -X POST http://gateway-api.e97e9e55a5d242f9a139.uksouth.aksapp.io/v2/messages \
-H "X-API-Key: $ESENDEX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"accountReference": "EX0000000",
"channel": "SMS",
"from": "Esendex",
"body": { "text": "Hello {{name}}, your order has shipped!" },
"recipients": [
{ "msisdn": "447700900000", "variables": { "name": "Alex" } }
]
}'

The API accepts the message for delivery and responds with 202 Accepted:

{
"data": {
"requestId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"messageIds": ["9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"]
},
"errors": null
}
3

Check the delivery status

Use the returned message ID with Get message by ID, or list everything sent as part of the request with Get messages from request.

curl http://gateway-api.e97e9e55a5d242f9a139.uksouth.aksapp.io/v2/messages/9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d \
-H "X-API-Key: $ESENDEX_API_KEY" \
-H "AccountReference: EX0000000"

Next steps