Developer API
HTTP API for sending SMS and voice messages from your own software.
Connect your own software to eSMS Africa with a simple HTTP API. Send text messages, place voice calls, convert text to speech, and read your account data. Every request goes to one endpoint and answers in JSON.
Endpoint: https://portal.esmsafrica.com/api/
https.Send a text message
https://portal.esmsafrica.com/api/?username=user&password=pass&message=test&sender=welcome&mobiles=2348030000000,2348020000000Replace user and pass with your account details. Separate several numbers with commas.
Example responses
Success
{"status":"OK","count":1,"price":2}Failed
{"error":"Login denied.","errno":"103"}Other optional parameters
| Parameter | Description |
|---|---|
contacts | The list of contact ids to send the message to. |
groups | The list of group ids to send the message to. |
numbers | The list of number ids to send the message to. |
type | The type of message: text, call or tts. |
message | The message text, or an audio reference number. |
Call message
https://portal.esmsafrica.com/api/?username=user&password=pass&message=391000&sender=2348030000000&mobiles=2348020000000&type=callUpload audio
Use action=upload and give the address of the audio file in url. The response contains a reference you can use later to play the audio in a call.
https://portal.esmsafrica.com/api/?username=user&password=pass&action=upload&url=https://example.com/sample.mp3Example response
{"status":"success","error":"","errno":"","data":{"reference":"ac798a79-f9e9-4662-c85b-f53ae1e62691","seconds":22,"size":"339.78KB"}}Send text to speech (TTS)
https://portal.esmsafrica.com/api/?username=user&password=pass&message=welcome+to+eSMS+Africa&type=tts&sender=2348040000000&mobiles=2348030000000Example response
{"status":"success","error":"","errno":"","data":{"f75cfaec-5565-2044-449a-71f474f9f7d7":"2348030000000"}}Send audio
Put the audio reference in message and set type=call.
https://portal.esmsafrica.com/api/?username=user&password=pass&message=ac798a79-f9e9-4662-c85b-f53ae1e62691&type=call&sender=441120000000&mobiles=441130000000Example response
{"status":"success","error":"","errno":"","data":{"b5703ef4-9730-c56e-d884-a314fe974cd6":441130000000}}Fetch account data
https://portal.esmsafrica.com/api/?username=user&password=pass&action=balanceChange the action value to read other data:
| Action | Returns |
|---|---|
login | Performs an account login to validate a user. |
profile | The customer profile of the account. |
balance | The current balance on the account. |
contacts | The saved contacts on the account. |
numbers | The saved numbers on the account. |
groups | The groups on the account. |
audios | The saved audios on the account. |
history | The message history on the account. |
scheduled | The scheduled messages on the account. |
reports | The delivery reports on the account. |
payments | The payment history on the account. |
Error codes
When a request fails, the response includes an errno from this list.
| Code | Meaning |
|---|---|
000 | Request successful |
100 | Incomplete request parameters |
101 | Request denied |
110 | Login status failed |
111 | Login status denied |
120 | Message limit reached |
121 | Mobile limit reached |
122 | Sender limit reached |
130 | Sender prohibited |
131 | Message prohibited |
140 | Invalid price setup |
141 | Invalid route setup |
142 | Invalid schedule date |
150 | Insufficient funds |
151 | Gateway denied access |
152 | Service denied access |
160 | File upload error |
161 | File upload limit |
162 | File restricted |
190 | Maintenance in progress |
191 | Internal error |
Need API access?
Talk to our team and we will help you get started. Contact us or message us on WhatsApp.