How to Send SMS Using URL Parameters
Send SMSes by making a HTTP GET
request with the following:
Endpoint
https://api.smsleopard.com/v1/sms/send?username={api_key}&password={api_secret}&message={intended_message}&destination={comma_separated_list}&source={sender_id}
Code Examples
curl -u https://api.smsleopard.com/v1/sms/send?username=api_key&password=api_secret&message=test&destination=254700000001&source=sms_leopard
Parameters
username
- This is the api_key obtained by generating you API keys.password
- This is the api_secret obtained by generating you API keys.message
- The SMS you intend to send to the recipient. Should be URL encoded.destination
- The phone numbers to send SMS to e.g.254700000001
. Do not include the plus symbol in the country code. If sending the same message to multiple recipients, the numbers can be comma-separated list e.g.254700000001,254700000002,254700000003
source
- A Sender ID of your smsleopard business account. If you have not yet been assigned any, useSMS_Leopard
for testing purposes. Click here (opens in a new tab) to learn more.
Example of a Successful Response
Status code: 201
{
"success": true,
"message": "Sent to 1/1. Cost KES 0.90",
"recipients": [
{
"id": "eb4647b2-2695-4aba-958e-0b39d965f6d0",
"cost": 0.9,
"number": "+254700000000",
"status": "queued"
}
]
}