Developer API

NextSMS API

Integrate reliable SMS delivery directly into your applications, websites and business systems using the NextSMS API.

Fast  •  Convenient  •  Reliable  •  Scalable

SMS API Endpoint
GET & POST requests supported
GET / POST https://nextsms.ug/api/sendsms/

Get Started

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.

Fast Integration

Connect your application to NextSMS using simple HTTP GET or POST requests.

SMS Delivery

Send SMS notifications, alerts, reminders and business messages directly from your application.

Scalable

Build integrations that can grow with your application's messaging requirements.

Request Parameters

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.

Message Types

Select the appropriate message type depending on how your application intends to send the SMS.

Info

Use this option when the message does not need to be delivered using a phone number.

Non Customised

Use this option when you are comfortable with a generic ID.

API Responses

The API returns a JSON response indicating whether the request was successful.

Success

Returned when the request is successfully processed.

{ "success": true, "message": "Your message" }
Error

Returned when the request cannot be processed.

{ "success": false, "error_message": "Your message" }

PHP GET Method

The following example demonstrates how to send an SMS using PHP and the NextSMS GET API.

send_sms.php
<?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);

?>
This example sends the message “Hallo NextSMS” to 2567xxxxxxxx.

Account Services

Additional API account management functionalities are available.

Recharge Account

API-based account recharge functionality allows applications to manage SMS programmatically.

Check Account Balance

Developers are able to retrieve their current NextSMS account balance through the API.

Ready to integrate NextSMS?

Create your NextSMS account and start integrating SMS communication into your application today.

Create Account