Our HTTP interface helps integrating your application to work with the SMS gateway to send SMS using HTTP protocol. You at your side can be using any language PHP, Python, Ruby or any other, integration is fairly simple and smooth that only requires an ability to open an URL to connect, pass parameters and send SMS. You need to have a valid API token to submit HTTP request to MumaraSmS. Generating API token has already been discussed in Rest API Document, here is the repetition of the process of generating API token.
Log into your account and generate your API token as first step.
Here is how it looks at first place before generating any API token. Click “Generate” button to generate your API token. The token doesn’t expire until you delete so you don’t need to generate a new token each time for sending API request.
After you have generated the API token, two new buttons will appear on your screen, to “Copy” the API token that you have generated and to “Delete” your existing API token.
The following area discusses the process of submitting “Get” request with required parameters to make correct calls to HTTP API for sending message.
API Token |
Valid API Token is required to get authorization to submitting request |
API Endpoint |
http://www.yourdomain.com/smpp-api |
Request Type |
Get |
Mobile No |
Mobile number of the contact to whom the message will be sent. The standard number format to add contact mobile number within MumaraSmS application is as follows.
The complete number would look like 92333XXXXXXX |
Sender ID |
Make sure you provide all the parameters without leaving any parameter value empty. If you don’t have any Sender ID approved, fill it with default Sender ID set within the system. Providing a wrong Sender ID will also take the default set Sender ID to send the message. However the empty parameter would give you an error. |
Mesage |
Your message text, make sure that the maximum length of one SMS is 160 characters, if your message exceeds from 160 characters, an extra credit will be charged from your account. So every message consisting of 160 characters is one text message, and crossing the 160 character limit will increase your SMS count. |
Following sample API HTTP Request illustrates that a request has been submitted to send “Test Message” using “HostingsH” as “Sender ID” to specific number in the number parameter.
Status value for the successfully executed request will be- “sent”
Data Returned-"Message ID" and "Mobile Number"
http://yourdomain.com/smpp-api?token=ba599823f57357d153ac45ca5a7XXXe&mobile_no=92333XXXXXXX
&sender_id=HostingsH&message=Test+Message
{"mobile_no":"92333XXXXXXX","message_id":"2b24bdfa-f846-4f43-9bbc-dd36630b4a49","status":"sent"}}
Following are few examples of erroneous responses upon submitting request with inappropriate or invalid information.
http://yourdomain.com/smpp-api?token=ba5823f57a4568XX7d7XXXe&mobile_no=92333XXXXXXX&sender_id=&message=Test+Message
{"Error":"Sender ID is Empty"}
http://yourdomain.com/smpp-api?token=ba5823f57a4568XX7d7XXXe&mobile_no=92333XXXXXXX&sender_id=&message=Test+Message{"Error":"Sender ID is Empty"}
http://yourdomain.com/smpp-api?token=ba58233ac45ca5a4568XX7d7XXXe&mobile_no=9233XXXXXX&sender_id=&{"mobile_no":"9233XXXXXX","status":"failed","description":"Number prefix missing"}
Status value for wrong/invalid Mobile Number value-http://yourdomain.com/smpp-api?token=ba5823f573ca5a48XX7d7XXXe&mobile_no=92333XXXXXXX&sender_id=&{"Error":"Invalid Parameter"}