HTTP & SMPP API
This is a brief explanation of how to send SMS using our HTTP API. The endpoint is https://api.demakatso.com:8080/send and the messages are submitted via HTTP POST.
HTTP curl Example
Curl Request:
curl -XPOST –insecure -d ‘{“username”:”SampleUser”,”password”:”SamplePassword”,”to”:”27791234567″,”content”:”Hello from api”, “Refno”: “7777”, “callback”:”http://sms-proxy.demakatso.com/callback.php“}’ -H”Content-Type:application/json” https://api.demakatso.com:8080/send
Successful Response:
{“Code”: 0,”Description”: “Success 874b64f8-f2ec-47f2-8da1-6f53cdfb13a6”}
HTTP API Request Header
Make sure you send a Content-Type header with the value application/json.
HTTP API Input Parameters
Name | Description |
---|---|
username | Your username supplied by Demakatso |
password | Your password supplied by Demakatso |
to | This is the MSISDN including country code. In the case of South Africa it is 11 digits starting with 27 e.g. 27791234567. Contact DeMaKatso support if you need to send to other countries other than South Africa. |
content | UTF-8 text message. One message consists of 160 characters but you will be able to submit messages longer than this. You will just be billed 1 credit per 160 characters of each message sent. |
Refno | This reference number is sent back to you via HTTP POST |
callback | This is the URL where we POST the status updates relating to the message |
HTTP API Response Parameter
Name | Description |
---|---|
Code | Response code which is 0 on success |
Description | Short description of result. A successful response has the word Success and a UUID as reference for the transaction. |
HTTP API Status Callback
As the networks send us updates about the messages you sent. We post updates via callbacks to your callback URL. The call back is in JSON format and is sent as a raw POST.
Example POST body looks like the below:
{“RespondID”:”8054fc54-b6c2-4d55-9d93-eb068ef83e27″,”DoneDate”:”2108201310″,”Connector”:”711521205″,”Status”:”DELIVRD”,”Text”:””}
Name | Description |
---|---|
RespondID | This is the UUID that matches the one you would have received when you submitted an SMS to the API |
DoneDate | When the network notification was received in the format YYMMDDHHMM. So the DoneDate within the example before which was 2108201310 is 20 August 2021 at 1:10pm |
Connector | Not important 🙂 |
Status | The state of the message. DELIVRD meaning the message was delivered to the handset. |
Text | Usually blank if no problem occurred but sometimes will contain further information if a problem occurred |