๐Ÿ“ก REST API ยท v1.0

SMS API
Integration Guide

Send SMS messages programmatically from any platform. Simple REST API with GET/POST support, compatible with all major languages and frameworks.

GET / POST
https://sms.gonlinesites.com/app/sms/api
Authentication

All API requests require an API key passed as the api_key parameter. Your key is available in the platform dashboard.

โš ๏ธ Keep your API key secret. Never expose it in client-side code or public repositories. Use environment variables instead.
Request Parameters

All five parameters are required for every send-sms request.

ParameterTypeDescription
actionrequiredstringAlways send-sms
api_keyrequiredstringYour API authentication key from the dashboard.
torequiredstringRecipient phone in international format e.g. +233244000000. Comma-separate multiple numbers for bulk.
fromrequiredstringRegistered Sender ID (max 11 alphanumeric chars) or a phone number.
smsrequiredstringThe message body. Max 160 chars per SMS unit โ€” longer messages split automatically.
unicodeoptionalintegerSet to 1 to send a Unicode SMS (supports Arabic, Chinese, emojis etc.). Max 70 chars per unit.
scheduleoptionalstringSchedule delivery time in format mm/dd/yyyy hh:mm AM. Example: 03/19/2026 10:36 AM. Must be a future time.
Response Codes

Every API response includes a numeric code field. Use this to handle outcomes precisely in your application.

Success Response
{
  "code"       : "OK",
  "message_id" : "MSG1234567890",
  "to"         : "+233244000000",
  "units"      : 1,
  "balance"    : 49
}
Error Response
{
  "code"    : 103,
  "message" : "Invalid phone number"
}
CodeMeaningHow to Handle
OKSuccessfully SentMessage accepted for delivery. Store the message_id for tracking.
100Bad gateway requestMalformed request. Verify the endpoint URL and all parameter names.
101Wrong actionThe action parameter must be exactly send-sms.
102Authentication failedInvalid api_key. Check your dashboard โ€” no extra spaces or characters.
103Invalid phone numberUse full international format: +233244000000. No spaces or dashes.
104Phone coverage not activeThe destination network is not supported or coverage is unavailable for that number.
105Insufficient balanceTop up your SMS credits in the platform dashboard.
106Invalid Sender IDYour Sender ID is not registered or exceeds 11 alphanumeric characters.
109Invalid Schedule TimeThe scheduled delivery time is invalid or in the past.
111SMS contains spam wordMessage flagged for review. Awaiting manual approval โ€” avoid promotional trigger words.
cURL

Test the API directly from your terminal.

terminal
# GET request
curl "https://sms.gonlinesites.com/app/sms/api?action=send-sms\
&api_key=YOUR_API_KEY\
&to=+233244000000\
&from=MySenderID\
&sms=Hello%20from%20the%20API"
terminal
# POST request
curl -X POST "https://sms.gonlinesites.com/app/sms/api" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "action=send-sms" \
  -d "api_key=YOUR_API_KEY" \
  -d "to=+233244000000" \
  -d "from=MySenderID" \
  -d "sms=Hello from the API"
Python

Use requests, built-in urllib, or a reusable client class.

send_sms.py
import requests

API_URL = "https://sms.gonlinesites.com/app/sms/api"
API_KEY = "YOUR_API_KEY"

def send_sms(to, sender_id, message):
    payload = {
        "action"  : "send-sms",
        "api_key" : API_KEY,
        "to"      : to,
        "from"    : sender_id,
        "sms"     : message,
    }
    try:
        r = requests.get(API_URL, params=payload, timeout=30)
        r.raise_for_status()
        data = r.json()

        if data.get("code") == "OK":
            print(f"Sent! ID: {data['message_id']}")
        else:
            print(f"Error {data['code']}: {data['message']}")
        return data
    except requests.exceptions.RequestException as e:
        return {"code": "error", "message": str(e)}

send_sms("+233244000000", "MySenderID", "Hello!")
send_sms_urllib.py
import urllib.request, urllib.parse, json

API_URL = "https://sms.gonlinesites.com/app/sms/api"
API_KEY = "YOUR_API_KEY"

def send_sms(to, sender_id, message):
    params = urllib.parse.urlencode({
        "action":"send-sms", "api_key":API_KEY,
        "to":to, "from":sender_id, "sms":message,
    })
    with urllib.request.urlopen(f"{API_URL}?{params}", timeout=30) as r:
        return json.loads(r.read().decode())

print(send_sms("+233244000000", "MySenderID", "Hello!"))
sms_client.py
import requests
from typing import Union, List

class SMSClient:
    BASE_URL = "https://sms.gonlinesites.com/app/sms/api"

    def __init__(self, api_key: str, sender_id: str):
        self.api_key   = api_key
        self.sender_id = sender_id
        self.session   = requests.Session()

    def send(self, to: Union[str, List[str]], message: str) -> dict:
        recipients = ",".join(to) if isinstance(to, list) else to
        r = self.session.get(self.BASE_URL, params={
            "action":"send-sms", "api_key":self.api_key,
            "to":recipients, "from":self.sender_id, "sms":message
        }, timeout=30)
        r.raise_for_status()
        return r.json()

sms = SMSClient("YOUR_API_KEY", "MySenderID")
sms.send("+233244000000", "Hello!")
sms.send(["+233244000000", "+233200111222"], "Bulk alert!")
PHP

Use cURL, file_get_contents, or Guzzle.

send_sms.php
<?php

define('SMS_API_URL', 'https://sms.gonlinesites.com/app/sms/api');
define('SMS_API_KEY', 'YOUR_API_KEY');

function sendSMS($to, $from, $message): array {
    $params = http_build_query([
        'action'  => 'send-sms',
        'api_key' => SMS_API_KEY,
        'to'      => $to,
        'from'    => $from,
        'sms'     => $message,
    ]);
    $ch = curl_init(SMS_API_URL . '?' . $params);
    curl_setopt_array($ch, [
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_TIMEOUT        => 30,
        CURLOPT_SSL_VERIFYPEER => true,
    ]);
    $response = curl_exec($ch);
    $error    = curl_error($ch);
    curl_close($ch);

    if ($error) return ['code' => 'error', 'message' => $error];
    $data = json_decode($response, true);

    if ($data['code'] === 'OK') {
        echo "Sent! ID: {$data['message_id']}";
    } else {
        echo "Error {$data['code']}: {$data['message']}";
    }
    return $data;
}

sendSMS('+233244000000', 'MySenderID', 'Hello!');
send_sms_simple.php
<?php
$query = http_build_query([
    'action'  => 'send-sms',
    'api_key' => 'YOUR_API_KEY',
    'to'      => '+233244000000',
    'from'    => 'MySenderID',
    'sms'     => 'Hello World!',
]);
$ctx  = stream_context_create(['http' => ['timeout' => 30]]);
$data = json_decode(file_get_contents("https://sms.gonlinesites.com/app/sms/api?{$query}", context: $ctx), true);
var_dump($data);
send_sms_guzzle.php
<?php
// composer require guzzlehttp/guzzle
use GuzzleHttp\Client;

$client   = new Client(['base_uri' => 'https://sms.gonlinesites.com']);
$response = $client->get('/app/sms/api', [
    'query' => [
        'action'  => 'send-sms',
        'api_key' => 'YOUR_API_KEY',
        'to'      => '+233244000000',
        'from'    => 'MySenderID',
        'sms'     => 'Hello via Guzzle!',
    ],
]);
print_r(json_decode($response->getBody(), true));
Laravel

Service class, Http Facade, config setup, and Notification channel.

app/Services/SmsService.php
<?php
namespace App\Services;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Log;

class SmsService
{
    protected string $apiKey;
    protected string $senderId;
    protected string $baseUrl = 'https://sms.gonlinesites.com/app/sms/api';

    public function __construct() {
        $this->apiKey   = config('sms.api_key');
        $this->senderId = config('sms.sender_id');
    }

    public function send(string $to, string $message): array
    {
        $response = Http::timeout(30)->get($this->baseUrl, [
            'action'  => 'send-sms',
            'api_key' => $this->apiKey,
            'to'      => $to,
            'from'    => $this->senderId,
            'sms'     => $message,
        ]);

        if ($response->failed()) {
            Log::error('SMS HTTP error', ['to' => $to]);
            return ['code' => 'error'];
        }
        $data = $response->json();

        if ($data['code'] !== 'OK') {
            Log::warning('SMS send error', $data);
        }
        return $data;
    }

    public function sendBulk(array $numbers, string $message): array {
        return $this->send(implode(',', $numbers), $message);
    }
}
SmsController.php
<?php
use Illuminate\Support\Facades\Http;

$response = Http::get('https://sms.gonlinesites.com/app/sms/api', [
    'action'  => 'send-sms',
    'api_key' => env('SMS_API_KEY'),
    'to'      => '+233244000000',
    'from'    => env('SMS_SENDER_ID'),
    'sms'     => 'Hello from Laravel!',
]);

$data = $response->json();

match ($data['code']) {
    'OK'  => logger("Sent: {$data['message_id']}"),
    102   => abort(401, 'SMS authentication failed'),
    105   => abort(402, 'Insufficient SMS balance'),
    default => logger("SMS error {$data['code']}: {$data['message']}"),
};
.env
SMS_API_KEY=YOUR_API_KEY
SMS_SENDER_ID=MySenderID
SMS_BASE_URL=https://sms.gonlinesites.com/app/sms/api
config/sms.php
<?php
return [
    'api_key'   => env('SMS_API_KEY'),
    'sender_id' => env('SMS_SENDER_ID', 'MySenderID'),
    'base_url'  => env('SMS_BASE_URL', 'https://sms.gonlinesites.com/app/sms/api'),
];
SmsNotification.php
<?php
namespace App\Notifications;
use Illuminate\Notifications\Notification;

class SmsNotification extends Notification
{
    public function __construct(protected string $message) {}

    public function via($notifiable): array
    { return ['sms']; }

    public function toSms($notifiable): array
    { return ['to' => $notifiable->phone_number, 'message' => $this->message]; }
}
// $user->notify(new SmsNotification('Your OTP is 4921'));
Node.js

Use axios, the native https module, or TypeScript.

sendSms.js
// npm install axios
const axios = require('axios');

async function sendSms(to, message) {
  const { data } = await axios.get('https://sms.gonlinesites.com/app/sms/api', {
    params: { action:'send-sms', api_key:'YOUR_API_KEY',
              to, from:'MySenderID', sms: message },
    timeout: 30000,
  });

  if (data.code === 'OK') {
    console.log(`Sent! ID: ${data.message_id}`);
  } else {
    console.error(`Error ${data.code}: ${data.message}`);
  }
  return data;
}

sendSms('+233244000000', 'Hello from Node!').catch(console.error);
sendSms_native.js
const https = require('https');
const qs    = require('querystring');

function sendSms(to, message) {
  return new Promise((resolve, reject) => {
    const q = qs.stringify({ action:'send-sms', api_key:'YOUR_API_KEY',
                              to, from:'MySenderID', sms: message });
    https.get(`https://sms.gonlinesites.com/app/sms/api?${q}`, res => {
      let b = '';
      res.on('data', c => b += c);
      res.on('end',  () => resolve(JSON.parse(b)));
    }).on('error', reject);
  });
}
sendSms('+233244000000', 'Hello!').then(console.log);
smsClient.ts
import axios from 'axios';

interface SmsResponse {
  code       : string | number;
  message_id?: string;
  message?   : string;
  units?     : number;
  balance?   : number;
}

export async function sendSms(
  to      : string | string[],
  message : string,
  from    : string = process.env.SMS_SENDER_ID ?? '',
): Promise<SmsResponse> {
  const recipients = Array.isArray(to) ? to.join(',') : to;
  const { data } = await axios.get<SmsResponse>(
    'https://sms.gonlinesites.com/app/sms/api', {
      params: { action:'send-sms', api_key: process.env.SMS_API_KEY,
                to: recipients, from, sms: message },
    }
  );
  if (data.code !== 'OK') throw new Error(`SMS ${data.code}: ${data.message}`);
  return data;
}
JavaScript (Browser)
โš ๏ธ Never expose your API key in client-side browser code. Route SMS requests through your own backend.
sms.js
const params = new URLSearchParams({
  action:'send-sms', api_key:'YOUR_API_KEY',
  to:'+233244000000', from:'MySenderID',
  sms:'Hello from the browser!',
});

fetch(`https://sms.gonlinesites.com/app/sms/api?${params}`)
  .then(r => r.json())
  .then(d => d.code === 'OK' ? console.log('Sent!', d) : console.error(d))
  .catch(console.error);
sms_async.js
async function sendSms({ to, from, message }) {
  const url = new URL('https://sms.gonlinesites.com/app/sms/api');
  Object.entries({ action:'send-sms', api_key:'YOUR_API_KEY', to, from, sms: message })
    .forEach(([k,v]) => url.searchParams.set(k,v));

  const data = await (await fetch(url)).json();
  if (data.code !== 'OK') throw new Error(`[${data.code}] ${data.message}`);
  return data;
}
Java

Java 11+ HttpClient or OkHttp for Android/legacy projects.

SmsClient.java
import java.net.*; import java.net.http.*;
import java.nio.charset.StandardCharsets; import java.time.Duration;

public class SmsClient {
    private static final String BASE   = "https://sms.gonlinesites.com/app/sms/api";
    private static final String KEY    = "YOUR_API_KEY";
    private static final String SENDER = "MySenderID";

    private final HttpClient http = HttpClient.newBuilder()
        .connectTimeout(Duration.ofSeconds(30)).build();

    public String send(String to, String msg) throws Exception {
        String url = BASE + "?action=send-sms"
            + "&api_key=" + URLEncoder.encode(KEY,    StandardCharsets.UTF_8)
            + "&to="      + URLEncoder.encode(to,     StandardCharsets.UTF_8)
            + "&from="    + URLEncoder.encode(SENDER,  StandardCharsets.UTF_8)
            + "&sms="     + URLEncoder.encode(msg,    StandardCharsets.UTF_8);
        return http.send(
            HttpRequest.newBuilder().uri(URI.create(url))
                .GET().timeout(Duration.ofSeconds(30)).build(),
            HttpResponse.BodyHandlers.ofString()
        ).body();
    }
}
SmsOkHttp.java
// implementation 'com.squareup.okhttp3:okhttp:4.12.0'
import okhttp3.*;

public class SmsOkHttp {
    private static final OkHttpClient CLIENT = new OkHttpClient();

    public static String send(String to, String msg) throws Exception {
        HttpUrl url = HttpUrl.parse("https://sms.gonlinesites.com/app/sms/api")
            .newBuilder()
            .addQueryParameter("action",  "send-sms")
            .addQueryParameter("api_key", "YOUR_API_KEY")
            .addQueryParameter("to",      to)
            .addQueryParameter("from",    "MySenderID")
            .addQueryParameter("sms",     msg).build();
        try (Response r = CLIENT.newCall(new Request.Builder().url(url).build()).execute()) {
            return r.body().string();
        }
    }
}
C# / .NET

Use HttpClient directly or register as a DI service.

SmsClient.cs
using System.Net.Http;
using System.Text.Json;

public class SmsClient
{
    private const string Base   = "https://sms.gonlinesites.com/app/sms/api";
    private const string ApiKey = "YOUR_API_KEY";
    private const string Sender = "MySenderID";
    private static readonly HttpClient _http = new();

    public static async Task<JsonDocument> SendAsync(string to, string msg)
    {
        var b = new UriBuilder(Base);
        var q = System.Web.HttpUtility.ParseQueryString(string.Empty);
        q["action"]="send-sms"; q["api_key"]=ApiKey;
        q["to"]=to; q["from"]=Sender; q["sms"]=msg;
        b.Query = q.ToString();
        var r = await _http.GetAsync(b.Uri);
        r.EnsureSuccessStatusCode();
        return JsonDocument.Parse(await r.Content.ReadAsStringAsync());
    }
}
SmsService.cs (DI)
// Program.cs
builder.Services.AddHttpClient<ISmsService, SmsService>();
builder.Services.Configure<SmsOptions>(builder.Configuration.GetSection("Sms"));

public interface ISmsService { Task<bool> SendAsync(string to, string msg); }

public class SmsService(HttpClient http, IOptions<SmsOptions> opts) : ISmsService
{
    public async Task<bool> SendAsync(string to, string msg) {
        var o = opts.Value;
        var r = await http.GetAsync(
            $"{o.BaseUrl}?action=send-sms&api_key={o.ApiKey}&to={to}&from={o.SenderId}&sms={Uri.EscapeDataString(msg)}");
        return r.IsSuccessStatusCode;
    }
}
// appsettings.json: { "Sms": { "ApiKey": "...", "SenderId": "...", "BaseUrl": "..." } }
Ruby

Built-in net/http or the httparty gem.

send_sms.rb
require 'net/http'; require 'uri'; require 'json'

def send_sms(to:, from:, message:)
  uri       = URI('https://sms.gonlinesites.com/app/sms/api')
  uri.query = URI.encode_www_form(
    action: 'send-sms', api_key: 'YOUR_API_KEY',
    to:, from:, sms: message
  )
  data = JSON.parse(Net::HTTP.get_response(uri).body)
  data['code'] == 'OK' ? puts("Sent: #{data['message_id']}") : puts("Error: #{data}")
  data
end

send_sms(to: '+233244000000', from: 'MySenderID', message: 'Hello!')
sms_httparty.rb
# gem install httparty
require 'httparty'

class SmsClient
  include HTTParty
  base_uri 'https://sms.gonlinesites.com'

  def initialize(api_key, sender)
    @key = api_key; @sender = sender
  end

  def send(to, message)
    self.class.get('/app/sms/api',
      query: { action: 'send-sms', api_key: @key, to:, from: @sender, sms: message })
  end
end

sms  = SmsClient.new('YOUR_API_KEY', 'MySenderID')
data = sms.send('+233244000000', 'Hello!')
puts data
Go

Idiomatic Go using net/http with typed response struct and error code handling.

sms.go
package main

import (
    "encoding/json"; "fmt"; "net/http"; "net/url"; "time"
)

type SMSResponse struct {
    Code      interface{} `json:"code"`
    MessageID string      `json:"message_id,omitempty"`
    Message   string      `json:"message,omitempty"`
    Units     int         `json:"units,omitempty"`
    Balance   int         `json:"balance,omitempty"`
}

func (r SMSResponse) OK() bool { c, _ := r.Code.(string); return c == "OK" }

func SendSMS(to, message string) (SMSResponse, error) {
    params := url.Values{
        "action"  : {"send-sms"},
        "api_key" : {"YOUR_API_KEY"},
        "to"      : {to},
        "from"    : {"MySenderID"},
        "sms"     : {message},
    }
    c := &http.Client{Timeout: 30 * time.Second}
    resp, err := c.Get("https://sms.gonlinesites.com/app/sms/api?" + params.Encode())
    if err != nil { return SMSResponse{}, err }
    defer resp.Body.Close()
    var result SMSResponse
    json.NewDecoder(resp.Body).Decode(&result)
    return result, nil
}

func main() {
    r, _ := SendSMS("+233244000000", "Hello from Go!")
    if r.OK() { fmt.Println("Sent:", r.MessageID) } else { fmt.Println("Error:", r.Code, r.Message) }
}
Google Forms

Automatically send SMS notifications when a Google Form is submitted โ€” one to the respondent confirming receipt, and one to your admin number with the full submission details. Uses Google Apps Script bound to your form.

๐Ÿ’ก This integration runs entirely on Google's servers โ€” no hosting required. The script converts Ghanaian local numbers (024xxxxxxx) to international format (23324xxxxxxx) automatically.
StepAction
1Open your Google Form โ†’ click the three-dot menu โ†’ Script editor
2Paste the full script below, replacing YOUR_API_KEY and YOUR_SENDER_ID
3Update adminPhone with your admin number in international format (e.g. 233242625794)
4Adjust the field order comments if your form fields are in a different order
5Save โ†’ Triggers (clock icon) โ†’ Add trigger โ†’ onFormSubmit โ†’ On form submit
6Authorise the script when prompted โ€” required for UrlFetchApp to make HTTP calls
Code.gs โ€” Google Apps Script
/**
 * Trigger: On form submit
 * Reads form responses, sends SMS to the respondent
 * and a summary SMS to the admin.
 *
 * Form fields (adjust indices to match your form order):
 *   0 = Name
 *   1 = Email
 *   2 = Phone Number
 *   3 = Comments
 */
function onFormSubmit(e) {
  try {
    var items    = e.response.getItemResponses();
    var name     = items[0].getResponse().trim();
    var email    = items[1].getResponse().trim();
    var phone    = formatGhanaPhone(items[2].getResponse());
    var comments = items[3].getResponse().trim();

    var adminPhone = "233242625794";  // โ† your admin number

    // SMS sent to the person who filled the form
    var userMessage =
      "Hello " + name +
      ", thanks for submitting the form successfully.";

    // SMS sent to the admin
    var adminMessage =
      "New form submission:\n" +
      "Name: "     + name     +
      "\nEmail: "   + email    +
      "\nPhone: "   + phone    +
      "\nComments: "+ comments;

    sendSMS(phone,      userMessage);
    sendSMS(adminPhone, adminMessage);

  } catch (error) {
    Logger.log("Error: " + error.toString());
  }
}

/**
 * Convert Ghana local numbers to international format.
 *   024xxxxxxx  โ†’  23324xxxxxxx
 *   Accepts already-formatted 233xxxxxxxxx unchanged.
 */
function formatGhanaPhone(number) {
  number = number.toString().replace(/\D/g, "");
  if (number.length === 10 && number.startsWith("0")) {
    return "233" + number.substring(1);
  }
  if (number.length === 12 && number.startsWith("233")) {
    return number;
  }
  return number; // return as-is if unrecognised format
}

/**
 * Send an SMS via the GONlineSites SMS API.
 * Uses UrlFetchApp โ€” no external libraries required.
 */
function sendSMS(to, message) {
  var url =
    "https://sms.gonlinesites.com/app/sms/api" +
    "?action=send-sms" +
    "&api_key=YOUR_API_KEY" +
    "&to="   + encodeURIComponent(to) +
    "&from=YOUR_SENDER_ID" +
    "&sms="  + encodeURIComponent(message);

  var response = UrlFetchApp.fetch(url, {
    muteHttpExceptions: true
  });
  Logger.log(response.getContentText());
}
sendSMS helper โ€” drop into any Apps Script project
/**
 * Reusable SMS helper for Google Apps Script.
 * Drop this function into any .gs file and call:
 *   sendSMS("+233244000000", "Your message here");
 */
function sendSMS(to, message) {
  var url =
    "https://sms.gonlinesites.com/app/sms/api" +
    "?action=send-sms" +
    "&api_key=YOUR_API_KEY" +
    "&to="   + encodeURIComponent(to) +
    "&from=YOUR_SENDER_ID" +
    "&sms="  + encodeURIComponent(message);

  var response = UrlFetchApp.fetch(url, {
    muteHttpExceptions: true
  });

  var result = JSON.parse(response.getContentText());
  if (result.code === "OK") {
    Logger.log("Sent successfully. ID: " + result.message_id);
  } else {
    Logger.log("SMS error [" + result.code + "]: " + result.message);
  }
  return result;
}
Custom field mapping โ€” flexible form structure
/**
 * Maps responses by question TITLE instead of index position.
 * More resilient โ€” survives reordering of form fields.
 */
function onFormSubmit(e) {
  try {
    var responses = {};
    e.response.getItemResponses().forEach(function(item) {
      responses[item.getItem().getTitle()] = item.getResponse();
    });

    // โ† change these strings to match your exact question titles
    var name     = (responses["Full Name"]     || "").trim();
    var email    = (responses["Email Address"] || "").trim();
    var phone    = formatGhanaPhone(responses["Phone Number"] || "");
    var comments = (responses["Comments"]      || "N/A").trim();

    var adminPhone = "233242625794";

    if (!phone) {
      Logger.log("No phone number found in response.");
      return;
    }

    sendSMS(phone,
      "Hello " + name + ", thanks for submitting the form successfully."
    );
    sendSMS(adminPhone,
      "New submission:\nName: "     + name  +
      "\nEmail: "   + email    +
      "\nPhone: "   + phone    +
      "\nComments: "+ comments
    );

  } catch (err) {
    Logger.log("Error: " + err.toString());
  }
}

// Paste formatGhanaPhone() and sendSMS() from the Full Script tab above
โš ๏ธ The trigger must be set to On form submit, not On form open. If authorisation prompts appear, you must approve them โ€” Apps Script requires explicit permission to call external URLs via UrlFetchApp.
SMS Types

The API supports three message types โ€” plain text, Unicode (extended character sets), and scheduled delivery. All share the same base endpoint.

๐Ÿ’ก Unicode messages support Arabic, Chinese, Greek, emoji, and other special characters, but are limited to 70 characters per SMS unit instead of the standard 160.
TypeExtra ParamChar Limit / UnitUse Case
Plain Textnone160 charsStandard English/Latin SMS
Unicodeunicode=170 charsArabic, Chinese, emoji, special scripts
Scheduledschedule=mm/dd/yyyy hh:mm AM160 charsDeliver at a future date and time
Plain / Standard SMS
https://sms.gonlinesites.com/app/sms/api
  ?action=send-sms
  &api_key=YOUR_API_KEY
  &to=PhoneNumber
  &from=SenderID
  &sms=YourMessage
Unicode SMS โ€” append unicode=1
https://sms.gonlinesites.com/app/sms/api
  ?action=send-sms
  &api_key=YOUR_API_KEY
  &to=PhoneNumber
  &from=SenderID
  &sms=YourMessage
  &unicode=1
Scheduled SMS โ€” append schedule=mm/dd/yyyy hh:mm AM
https://sms.gonlinesites.com/app/sms/api
  ?action=send-sms
  &api_key=YOUR_API_KEY
  &to=PhoneNumber
  &from=SenderID
  &sms=YourMessage
  &schedule=03/19/2026 10:36 AM
Schedule SMS

Add the optional schedule parameter to any send-sms request to delay delivery to a specific future time.

ParameterFormatExample
scheduleoptional mm/dd/yyyy hh:mm AM 03/19/2026 10:36 AM
โš ๏ธ The schedule time must be in the future. Passing a past timestamp will return error code 109 โ€” Invalid Schedule Time.
schedule_sms.py
import requests
from datetime import datetime

# Format: mm/dd/yyyy hh:mm AM
schedule_time = "03/19/2026 10:36 AM"

# Or build it dynamically
dt            = datetime(2026, 3, 19, 10, 36)
schedule_time = dt.strftime("%m/%d/%Y %I:%M %p")

payload = {
    "action"   : "send-sms",
    "api_key"  : "YOUR_API_KEY",
    "to"       : "+233244000000",
    "from"     : "MySenderID",
    "sms"      : "This is a scheduled reminder!",
    "schedule" : schedule_time,   # mm/dd/yyyy hh:mm AM
}

r = requests.get("https://sms.gonlinesites.com/app/sms/api", params=payload, timeout=30)
print(r.json())
schedule_sms.php
<?php

// Format: mm/dd/yyyy hh:mm AM
$scheduleTime = '03/19/2026 10:36 AM';

// Or build it dynamically
$scheduleTime = date('m/d/Y h:i A', strtotime('+2 hours'));

$params = http_build_query([
    'action'   => 'send-sms',
    'api_key'  => 'YOUR_API_KEY',
    'to'       => '+233244000000',
    'from'     => 'MySenderID',
    'sms'      => 'This is a scheduled reminder!',
    'schedule' => $scheduleTime,
]);

$ch = curl_init('https://sms.gonlinesites.com/app/sms/api?' . $params);
curl_setopt_array($ch, [CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($data);
Laravel โ€” schedule via Carbon
use Carbon\Carbon;
use Illuminate\Support\Facades\Http;

// Format: mm/dd/yyyy hh:mm AM
$scheduleTime = Carbon::now()->addHours(2)->format('m/d/Y h:i A');

$response = Http::get('https://sms.gonlinesites.com/app/sms/api', [
    'action'   => 'send-sms',
    'api_key'  => config('sms.api_key'),
    'to'       => '+233244000000',
    'from'     => config('sms.sender_id'),
    'sms'      => 'Scheduled reminder from Laravel!',
    'schedule' => $scheduleTime,
]);

return $response->json();
schedule_sms.js
const axios = require('axios');

// Format: mm/dd/yyyy hh:mm AM
function formatSchedule(date) {
  const mm  = String(date.getMonth() + 1).padStart(2, '0');
  const dd  = String(date.getDate()).padStart(2, '0');
  const yy  = date.getFullYear();
  let   hh  = date.getHours();
  const min = String(date.getMinutes()).padStart(2, '0');
  const ampm = hh >= 12 ? 'PM' : 'AM';
  hh = hh % 12 || 12;
  return `${mm}/${dd}/${yy} ${hh}:${min} ${ampm}`;
}

const sendAt = new Date(Date.now() + 2 * 60 * 60 * 1000); // 2 hrs from now

axios.get('https://sms.gonlinesites.com/app/sms/api', {
  params: {
    action   : 'send-sms',
    api_key  : 'YOUR_API_KEY',
    to       : '+233244000000',
    from     : 'MySenderID',
    sms      : 'Scheduled reminder!',
    schedule : formatSchedule(sendAt),
  },
}).then(r => console.log(r.data));
terminal
curl "https://sms.gonlinesites.com/app/sms/api\
?action=send-sms\
&api_key=YOUR_API_KEY\
&to=+233244000000\
&from=MySenderID\
&sms=Scheduled+reminder\
&schedule=03/19/2026+10:36+AM"
Balance Check

Query your account's remaining SMS credit balance at any time using the check-balance action.

Endpoint
https://sms.gonlinesites.com/app/sms/api
  ?action=check-balance
  &api_key=YOUR_API_KEY
  &response=json
ParameterValueDescription
actioncheck-balanceAction type for balance queries.
api_keyYour keyYour API authentication key.
responsejsonReturn format. Always use json.
Response
{
  "status"  : "success",
  "balance" : "245",
  "currency": "credits"
}
check_balance.py
import requests

def check_balance(api_key):
    r = requests.get(
        "https://sms.gonlinesites.com/app/sms/api",
        params={"action": "check-balance", "api_key": api_key, "response": "json"},
        timeout=30
    )
    data = r.json()
    print(f"Balance: {data['balance']} {data.get('currency','credits')}")
    return data

check_balance("YOUR_API_KEY")
check_balance.php
<?php

$query = http_build_query([
    'action'   => 'check-balance',
    'api_key'  => 'YOUR_API_KEY',
    'response' => 'json',
]);

$ctx  = stream_context_create(['http' => ['timeout' => 30]]);
$data = json_decode(
    file_get_contents("https://sms.gonlinesites.com/app/sms/api?{$query}", context: $ctx),
    true
);
echo "Balance: {$data['balance']} credits";
Laravel โ€” SmsService.php addition
public function checkBalance(): array
{
    return Http::timeout(30)->get($this->baseUrl, [
        'action'   => 'check-balance',
        'api_key'  => $this->apiKey,
        'response' => 'json',
    ])->json();
}

// Usage: $smsService->checkBalance()['balance']
checkBalance.js
const axios = require('axios');

async function checkBalance(apiKey) {
  const { data } = await axios.get(
    'https://sms.gonlinesites.com/app/sms/api', {
      params: { action: 'check-balance', api_key: apiKey, response: 'json' },
    }
  );
  console.log(`Balance: ${data.balance} credits`);
  return data;
}

checkBalance('YOUR_API_KEY');
terminal
curl "https://sms.gonlinesites.com/app/sms/api\
?action=check-balance\
&api_key=YOUR_API_KEY\
&response=json"
Contacts Insert API

Add phone numbers directly to a contact list (phonebook) in your account using the Contacts API endpoint.

Endpoint
https://sms.gonlinesites.com/app/contacts/api
  ?action=subscribe-us
  &api_key=YOUR_API_KEY
  &phone_book=ContactListName
  &phone_number=PhoneNumber
  &first_name=FirstName        (optional)
  &last_name=LastName          (optional)
  &email=EmailAddress          (optional)
  &company=Company             (optional)
  &user_name=UserName          (optional)
ParameterTypeDescription
actionrequiredstringAlways subscribe-us for contact inserts.
api_keyrequiredstringYour API authentication key.
phone_bookrequiredstringName of the contact list / phonebook to add the contact to.
phone_numberrequiredstringPhone number in international format e.g. +233244000000.
first_nameoptionalstringContact's first name.
last_nameoptionalstringContact's last name.
emailoptionalstringContact's email address.
companyoptionalstringContact's company or organisation name.
user_nameoptionalstringA username or unique identifier for the contact.
add_contact.py
import requests

CONTACTS_URL = "https://sms.gonlinesites.com/app/contacts/api"
API_KEY      = "YOUR_API_KEY"

def add_contact(phone_book, phone_number, **kwargs):
    """
    Add a contact to a phonebook.
    Optional kwargs: first_name, last_name, email, company, user_name
    """
    payload = {
        "action"       : "subscribe-us",
        "api_key"      : API_KEY,
        "phone_book"   : phone_book,
        "phone_number" : phone_number,
        **kwargs,
    }
    r = requests.get(CONTACTS_URL, params=payload, timeout=30)
    return r.json()

# Minimal
add_contact("Customers", "+233244000000")

# With optional fields
add_contact(
    "Customers", "+233244000000",
    first_name="Kwame", last_name="Mensah",
    email="kwame@example.com", company="Acme Ltd",
)
add_contact.php
<?php

function addContact(string $phoneBook, string $phoneNumber, array $extra = []): array
{
    $params = http_build_query(array_filter(array_merge([
        'action'       => 'subscribe-us',
        'api_key'      => 'YOUR_API_KEY',
        'phone_book'   => $phoneBook,
        'phone_number' => $phoneNumber,
    ], $extra)));

    $ctx = stream_context_create(['http' => ['timeout' => 30]]);
    return json_decode(
        file_get_contents("https://sms.gonlinesites.com/app/contacts/api?{$params}", context: $ctx),
        true
    );
}

// Minimal
addContact('Customers', '+233244000000');

// With optional fields
addContact('Customers', '+233244000000', [
    'first_name' => 'Kwame',
    'last_name'  => 'Mensah',
    'email'      => 'kwame@example.com',
    'company'    => 'Acme Ltd',
]);
Laravel โ€” SmsService.php addition
protected string $contactsUrl = 'https://sms.gonlinesites.com/app/contacts/api';

public function addContact(
    string $phoneBook,
    string $phoneNumber,
    array  $extra = []
): array {
    return Http::timeout(30)->get($this->contactsUrl, array_filter(array_merge([
        'action'       => 'subscribe-us',
        'api_key'      => $this->apiKey,
        'phone_book'   => $phoneBook,
        'phone_number' => $phoneNumber,
    ], $extra)))->json();
}

// Usage
// $sms->addContact('Customers', '+233244000000', ['first_name' => 'Kwame']);
addContact.js
const axios = require('axios');

async function addContact(phoneBook, phoneNumber, extra = {}) {
  const { data } = await axios.get(
    'https://sms.gonlinesites.com/app/contacts/api', {
      params: {
        action       : 'subscribe-us',
        api_key      : 'YOUR_API_KEY',
        phone_book   : phoneBook,
        phone_number : phoneNumber,
        ...extra,
      },
    }
  );
  return data;
}

// Minimal
addContact('Customers', '+233244000000');

// With optional fields
addContact('Customers', '+233244000000', {
  first_name : 'Kwame',
  last_name  : 'Mensah',
  email      : 'kwame@example.com',
  company    : 'Acme Ltd',
});
terminal
# Minimal
curl "https://sms.gonlinesites.com/app/contacts/api\
?action=subscribe-us\
&api_key=YOUR_API_KEY\
&phone_book=Customers\
&phone_number=+233244000000"

# With optional fields
curl "https://sms.gonlinesites.com/app/contacts/api\
?action=subscribe-us\
&api_key=YOUR_API_KEY\
&phone_book=Customers\
&phone_number=+233244000000\
&first_name=Kwame\
&last_name=Mensah\
&email=kwame%40example.com\
&company=Acme+Ltd"
Bulk SMS

Send to multiple recipients by comma-separating the to parameter.

bulk_sms.py
import requests

numbers = ["+233244000001", "+233244000002", "+233200111222"]
r = requests.get("https://sms.gonlinesites.com/app/sms/api", params={
    "action":"send-sms", "api_key":"YOUR_API_KEY",
    "to":",".join(numbers),
    "from":"MySenderID", "sms":"Important announcement!",
})
data = r.json()
print("Sent" if data['code'] == 'OK' else data)
bulk_sms.php
<?php
$numbers = ['+233244000001', '+233244000002', '+233200111222'];
$query   = http_build_query([
    'action'  => 'send-sms',
    'api_key' => 'YOUR_API_KEY',
    'to'      => implode(',', $numbers),
    'from'    => 'MySenderID',
    'sms'     => 'Announcement for all customers!',
]);
print_r(json_decode(file_get_contents("https://sms.gonlinesites.com/app/sms/api?{$query}"), true));
bulk_sms.js
const axios   = require('axios');
const numbers = ['+233244000001', '+233244000002', '+233200111222'];
axios.get('https://sms.gonlinesites.com/app/sms/api', {
  params: { action:'send-sms', api_key:'YOUR_API_KEY',
            to: numbers.join(','), from:'MySenderID', sms:'Announcement!' }
}).then(r => console.log(r.data));
Notes & Best Practices

Keep these in mind when integrating the SMS API into your application.

๐Ÿ“‹
Multiple Recipients To send to multiple phone numbers at once, separate each number with a comma when assigning the to parameter.
&to=+233244000001,+233244000002,+233200111222
๐Ÿ”—
URL-Encode Special Characters Parameters containing special characters โ€” such as #, *, %, spaces, or emojis like ๐Ÿ‘จ๐Ÿผโ€๐Ÿ’ป โ€” must be URL-encoded before being included in the HTTP request. Failing to encode these characters can corrupt the request or cause unexpected errors.

Most HTTP libraries (requests, axios, Guzzle, Http facade) handle this automatically when you pass parameters as a dictionary or array. When building URLs manually, use your language's encoding function:

Python: urllib.parse.quote(text)
PHP: urlencode($text)
JS: encodeURIComponent(text)
Java: URLEncoder.encode(text, StandardCharsets.UTF_8)
๐Ÿ“Š
Delivery & SMS History SMS messages sent via the API are delivered to recipients shortly after the request is made. You can log in to your SMS dashboard at any time to view your full SMS history and check the delivery status of each message sent.
Response Codes Reference

Complete list of all API response codes and recommended handling for each.

CodeMeaningRecommended Action
OKSuccessfully SentMessage accepted. Log the message_id and update delivery status.
100Bad gateway requestCheck the endpoint URL, HTTP method, and all parameter names. Likely a malformed request.
101Wrong actionThe action parameter value must be exactly send-sms. Check for typos.
102Authentication failedThe api_key is invalid or expired. Verify your key in the dashboard. No leading/trailing spaces.
103Invalid phone numberUse full international format with country code: +233244000000. Remove spaces, dashes, and parentheses.
104Phone coverage not activeThe destination network or country is not covered. Contact support to check available routes.
105Insufficient balanceYour account credit is too low. Log in to the dashboard and top up before retrying.
106Invalid Sender IDThe Sender ID is not registered on the platform or exceeds 11 alphanumeric characters. Register it in your dashboard.
109Invalid Schedule TimeThe scheduled time is in the past or uses an invalid format. Use a future UTC timestamp.
111SMS contains spam wordMessage was flagged and is awaiting manual approval. Revise content to avoid common spam trigger words.