API v3.0 - Live & Ready

SMS API Documentation

Integrate powerful SMS messaging into your applications with our simple, reliable API. Send messages globally with just a few lines of code.

Authentication

All API requests require authentication using a Bearer token. You can obtain your API token from your dashboard.

Authorization Header
Authorization: Bearer YOUR_API_TOKEN

Send SMS

Send an SMS message to a single recipient using our API endpoint.

POST Request
POST https://sms.webline.africa/api/v3/sms/send

Query Parameters

Parameter Type Required Description
recipient string Yes Phone number in international format (e.g., +255734666100)
sender_id string Yes Sender ID (up to 11 characters)
message string Yes Message content (URL encoded)

Code Examples

PHP (cURL)
<?php
$curl = curl_init();
curl_setopt_array($curl, [
  CURLOPT_URL => "https://sms.webline.africa/api/v3/sms/send?recipient=%2B255734666100&sender_id=Webline&message=Hogera%20Utajibiwa%20kupitia%20mawasilian",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer YOUR_API_TOKEN"
  ],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
JavaScript (Fetch)
const url = 'https://sms.webline.africa/api/v3/sms/send?recipient=%2B255734666100&sender_id=Webline&message=Hogera%20Utajibiwa%20kupitia%20mawasilian';
const options = {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_TOKEN'
  }
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error('error:' + err));
Python (Requests)
import requests

url = "https://sms.webline.africa/api/v3/sms/send"
params = {
    "recipient": "+255734666100",
    "sender_id": "Webline",
    "message": "Hogera Utajibiwa kupitia mawasilian"
}
headers = {
    "Authorization": "Bearer YOUR_API_TOKEN"
}

response = requests.post(url, params=params, headers=headers)
print(response.json())

Responses

Success Response

A successful request will return a JSON object with the message ID and status.

200 OK
{
  "status": "success",
  "message_id": "12345-abcdef",
  "recipient": "+255734666100",
  "delivery_status": "SENT"
}

Error Response

If an error occurs, the API will return a JSON object with a descriptive error message.

401 Unauthorized
{
  "status": "error",
  "message": "Invalid API token."
}