Our platform offers a fairly simple way as opening a URL to connect to our HTTP API and send your short message text. Whether you are using PHP, Python, Ruby or any other language at your application side, all you need to have is an ability to open up the URL to connect the platform for sending SMS. To use our API, you need to have a valid API Token, if you already have one you can use it, and if you don’t have it, go ahead and generate a new one. Generating API token has already been discussed that you can reach by clicking the following link.
Parameter and Values
Parameter | Type | Value |
End Point | Required | portal.smsstream.com/smpp-api |
Authentication | Required | Your valid API token |
Mobile Number (Parameter) | Required | Put forward mobile number of the contact; and make sure you follow the standard number format. |
Sender ID (Parameter) | Required | If you have an active Sender ID approved by the admin, use it here to send your message from. Or, use default Sender ID (SMSstream) in case you don’t have a sender ID approved. |
Message (Parameter) | Required | Your message text here. |
Successful Request
Following API request is submitted to send “Test Message” from the sender id “SMSstream” to specific number the number parameter. All other requirements like API token for authentication are also carried out correctly. You will get your message successfully sent and will get the following success response.
Status Value- Success
Data Returned- 1) Message ID and 2) Mobile Number
Request (Get)
1 | http://portal.smsstream.com/smpp-api?token=15642319684x7823s12&mobile_no=92333XXXXXXX&sender_id=SMSstream&message=Test+Message </> |
Response
1 | {"mobile_no":"92333XXXXXXX","message_id":"2b24bdfa-f846-4f43-9bbc-dd36630b4a49","status":"sent"}} |
Erroneous Requests
Following area illustrates some of the error requests and their responses accordingly.
Empty Sender ID Parameter
Request
1 | http://portal.smsstream.com/smpp-api?token=15642319684x7823s12&mobile_no=92333XXXXXXX&sender_id=&message=Test+Message </> |
Response
1 | {"Error":"Sender ID is Empty"} |
Invalid API Token
Request
1 | http://portal.smsstream.com/smpp-api?token=wrong_api_token&mobile_no=92333XXXXXXX&sender_id=SMSstream&message=Test+Message </> |
Response
1 | {"Authorization":"Failed"} |
Parameter Error
Request
1 | http://portal.smsstream.com/smpp-api?token=wrong_api_token&=92333XXXXXXX&sender_id=SMSstream&message=Test+Message </> |
Response
1 | {"Invalid Parameter"} |
Invalid/Wrong Mobile Number
When you submit a request with wrong/invalid number.
Status Value-Failed
Date Returned-Mobile Number
Description- A short text describing the reason of failure.
Request
1 | http://portal.smsstream.com/smpp-api?token=wrong_api_token&=9233357854987987912&sender_id=SMSstream&message=Test+Message </> |
Response
1 | {"mobile_no":"9233XXXXXX","status":"failed","description":"Number prefix missing"} |