Integrate reliable SMS delivery directly into your applications, websites and business systems using the NextSMS API.
Fast • Convenient • Reliable • Scalable
The NextSMS API allows developers to send SMS messages from websites, applications and other software systems. To use the API, you must have an active NextSMS account.
Connect your application to NextSMS using simple HTTP GET or POST requests.
Send SMS notifications, alerts, reminders and business messages directly from your application.
Build integrations that can grow with your application's messaging requirements.
The following parameters are used when sending an SMS through the NextSMS API.
| Parameter | Required | Description |
|---|---|---|
| number | REQUIRED |
Recipient phone number. Example:
2567XXXXXXXX
|
| message | REQUIRED | The SMS message to be sent. A single SMS supports a maximum of 160 characters. |
| identifier | REQUIRED | The ID displayed to the recipient. |
| username | REQUIRED | Your NextSMS API username. |
| password | REQUIRED | Your NextSMS API password. |
| message_type | REQUIRED | Defines the identifier/message configuration. |
| message_category | REQUIRED |
Defines the category of the SMS request,
for example bulk.
|
Select the appropriate message type depending on how your application intends to send the SMS.
Use this option when the message does not need to be delivered using a phone number.
Use this option when you are comfortable with a generic ID.
The API returns a JSON response indicating whether the request was successful.
Returned when the request is successfully processed.
Returned when the request cannot be processed.
The following example demonstrates how to send an SMS using PHP and the NextSMS GET API.
<?php
function sendSMS(
$message_type,
$message_category,
$number,
$message
) {
$username = 'your_username';
$password = 'your_password';
$identifier = 'your_sender_id';
$url = "https://nextsms.ug/api/sendsms/?";
$parameters =
"number=[number]" .
"&message=[message]" .
"&username=[username]" .
"&password=[password]" .
"&identifier=[identifier]" .
"&message_type=[message_type]" .
"&message_category=[message_category]";
$parameters = str_replace(
"[message]",
urlencode($message),
$parameters
);
$parameters = str_replace(
"[identifier]",
urlencode($identifier),
$parameters
);
$parameters = str_replace(
"[number]",
urlencode($number),
$parameters
);
$parameters = str_replace(
"[username]",
urlencode($username),
$parameters
);
$parameters = str_replace(
"[password]",
urlencode($password),
$parameters
);
$parameters = str_replace(
"[message_type]",
urlencode($message_type),
$parameters
);
$parameters = str_replace(
"[message_category]",
urlencode($message_category),
$parameters
);
$live_url = $url . $parameters;
$parse_url = file($live_url);
$response = $parse_url[0];
return json_decode($response, true);
}
// Send SMS
$response = sendSMS(
'non_customised',
'bulk',
'2567xxxxxxxx',
'Hallo NextSMS'
);
print_r($response);
?>
Additional API account management functionalities are available.
API-based account recharge functionality allows applications to manage SMS programmatically.
Developers are able to retrieve their current NextSMS account balance through the API.
Create your NextSMS account and start integrating SMS communication into your application today.
Create Account