Overview
The Africa One Solutions API is a RESTful interface for sending transactional and campaign SMS, querying delivery status, and managing contacts. All endpoints return JSON.
Base URL
https://sms.africaonesolutions.co.tz/api/v3
Content type
application/json
Charset
UTF-8
Every path below is relative to that base URL. The legacy /api/http prefix serves the same endpoints with the same payloads, so an integration written against the older platform keeps working unchanged — including
sms/send over GET or POST, with the fields in the query string, which is how many existing integrations call it. A recipient outside the countries your account may send to is skipped rather than failing the whole request: the response reports
requested, sent_to and skipped, so a partial delivery is never presented as a complete one.
Authentication
Every request must present an API key. The preferred form is a Bearer token in the Authorization header.
Authorization: Bearer <your_api_token>
For backward compatibility the same key may also be sent as an api_token query parameter, a form field, a JSON body field, or an api_token cookie. The header is checked first, then the query string, cookie, form body, and JSON body.
curl -X POST "https://sms.africaonesolutions.co.tz/api/v3/sms/send" \
-H "Content-Type: application/json" \
-d '{
"api_token": "<your_api_token>",
"recipient": "255717222303",
"message": "Hello",
"sender_id": "YOURID"
}'
Create and revoke keys in the dashboard under API Keys, where each key can be named for the system that uses it. A request with no key, or a revoked one, answers 401 Unauthorized; a key whose account may not send answers 403 Forbidden.
Response envelope
Every response is wrapped in a consistent envelope. The status field is success, error, or info. The data field contains the payload when the request succeeds.
{
"status": "success",
"message": "Message accepted for delivery",
"data": {
"uid": "abc123",
"to": "255717222303",
"from": "YOURID",
"message": "Hello",
"sms_type": "plain",
"status": "queued",
"direction": "api",
"sms_count": 1,
"cost": "1",
"sent_at": "2026-10-16T09:41:12Z"
}
}
{
"status": "error",
"message": "Sender ID \"SHADOW\" is not authorized to send this message."
}
A send that the network refuses is reported as info with HTTP 200: the request was valid, but the message was not accepted for delivery, and the message field carries the reason.
HTTP status codes
| Code | Meaning |
|---|---|
| 200 | Request handled. Check status: success, error (rare on 200) or info. |
| 401 | Missing or invalid API key. |
| 403 | The account or API access is not enabled, or the sender ID is not authorized for it. |
| 404 | The record does not exist, or does not belong to the authenticated account. |
| 422 | Validation failed: missing recipient, message or sender ID, an unparsable datetime, or insufficient balance. |
| 500 | Unexpected server error. Safe to retry the read endpoints. |
/sms/send
Send a single SMS message to one recipient.
Sample request
curl -X POST "https://sms.africaonesolutions.co.tz/api/v3/sms/send" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"recipient":"255717222303","message":"Hello from the API","sender_id":"YOURID"}'
<?php
$ch = curl_init('https://sms.africaonesolutions.co.tz/api/v3/sms/send');
$options = [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer YOUR_API_TOKEN',
'Accept: application/json',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => '{"recipient":"255717222303","message":"Hello from the API","sender_id":"YOURID"}',
];
curl_setopt_array($ch, $options);
$response = curl_exec($ch);
if ($response === false) {
throw new RuntimeException(curl_error($ch));
}
curl_close($ch);
echo $response;
// Node.js 18+ (global fetch)
const res = await fetch('https://sms.africaonesolutions.co.tz/api/v3/sms/send', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_API_TOKEN',
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({"recipient":"255717222303","message":"Hello from the API","sender_id":"YOURID"}),
});
const data = await res.json();
console.log(data);
// Java 11+
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://sms.africaonesolutions.co.tz/api/v3/sms/send"))
.header("Authorization", "Bearer YOUR_API_TOKEN")
.header("Accept", "application/json")
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\"recipient\":\"255717222303\",\"message\":\"Hello from the API\",\"sender_id\":\"YOURID\"}"))
.build();
HttpResponse<String> response =
client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
body := strings.NewReader(`{"recipient":"255717222303","message":"Hello from the API","sender_id":"YOURID"}`)
req, err := http.NewRequest("POST", "https://sms.africaonesolutions.co.tz/api/v3/sms/send", body)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")
req.Header.Set("Accept", "application/json")
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(out))
}
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| recipient | string | yes | Destination phone number in E.164 or local format. Punctuation is ignored; 9–15 digits are accepted. |
| message | string | yes | Message body. Long messages are split and concatenated automatically. |
| sender_id | string | yes | Approved sender ID for your account. |
| type | string | no | Message type: plain (default) or unicode. otp is accepted and sent as plain. |
A recipient holding a comma-separated list is treated as a bulk send and answered like /sms/campaign, so one call can address a list. Each number is billed separately; duplicates in the same request are sent once.
/sms/campaign
Send a bulk campaign to multiple recipients.
Sample request
curl -X POST "https://sms.africaonesolutions.co.tz/api/v3/sms/campaign" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"name":"October promo","recipient":"255717222303,255712345678","message":"Hello from the API","sender_id":"YOURID"}'
<?php
$ch = curl_init('https://sms.africaonesolutions.co.tz/api/v3/sms/campaign');
$options = [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer YOUR_API_TOKEN',
'Accept: application/json',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => '{"name":"October promo","recipient":"255717222303,255712345678","message":"Hello from the API","sender_id":"YOURID"}',
];
curl_setopt_array($ch, $options);
$response = curl_exec($ch);
if ($response === false) {
throw new RuntimeException(curl_error($ch));
}
curl_close($ch);
echo $response;
// Node.js 18+ (global fetch)
const res = await fetch('https://sms.africaonesolutions.co.tz/api/v3/sms/campaign', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_API_TOKEN',
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({"name":"October promo","recipient":"255717222303,255712345678","message":"Hello from the API","sender_id":"YOURID"}),
});
const data = await res.json();
console.log(data);
// Java 11+
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://sms.africaonesolutions.co.tz/api/v3/sms/campaign"))
.header("Authorization", "Bearer YOUR_API_TOKEN")
.header("Accept", "application/json")
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\"name\":\"October promo\",\"recipient\":\"255717222303,255712345678\",\"message\":\"Hello from the API\",\"sender_id\":\"YOURID\"}"))
.build();
HttpResponse<String> response =
client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
body := strings.NewReader(`{"name":"October promo","recipient":"255717222303,255712345678","message":"Hello from the API","sender_id":"YOURID"}`)
req, err := http.NewRequest("POST", "https://sms.africaonesolutions.co.tz/api/v3/sms/campaign", body)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")
req.Header.Set("Accept", "application/json")
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(out))
}
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| recipient | string | yes | Comma-separated list of phone numbers. |
| message | string | yes | Campaign message body. |
| sender_id | string | yes | Approved sender ID. |
| name | string | no | Campaign name. Generated automatically if omitted. |
| type | string | no | plain (default) or unicode. |
{
"status": "success",
"message": "Campaign created successfully",
"data": {
"uid": "campaign123",
"name": "Launch Campaign"
}
}
The whole campaign is checked against your balance before it is accepted, so a list you cannot afford is refused with 422 instead of being created and then skipped.
/sms
List sent messages for the authenticated user. The default window is the last 30 days, 25 rows per page, in the Laravel paginator shape (data, current_page, last_page, total, links).
Sample request
curl -X GET "https://sms.africaonesolutions.co.tz/api/v3/sms?per_page=25&page=1" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json"
<?php
$ch = curl_init('https://sms.africaonesolutions.co.tz/api/v3/sms?per_page=25&page=1');
$options = [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer YOUR_API_TOKEN',
'Accept: application/json',
],
];
curl_setopt_array($ch, $options);
$response = curl_exec($ch);
if ($response === false) {
throw new RuntimeException(curl_error($ch));
}
curl_close($ch);
echo $response;
// Node.js 18+ (global fetch)
const res = await fetch('https://sms.africaonesolutions.co.tz/api/v3/sms?per_page=25&page=1', {
method: 'GET',
headers: {
Authorization: 'Bearer YOUR_API_TOKEN',
Accept: 'application/json',
},
});
const data = await res.json();
console.log(data);
// Java 11+
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://sms.africaonesolutions.co.tz/api/v3/sms?per_page=25&page=1"))
.header("Authorization", "Bearer YOUR_API_TOKEN")
.header("Accept", "application/json")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> response =
client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
req, err := http.NewRequest("GET", "https://sms.africaonesolutions.co.tz/api/v3/sms?per_page=25&page=1", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")
req.Header.Set("Accept", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(out))
}
Query parameters
| Parameter | Description |
|---|---|
| page | Page number (default 1). |
| start_date | Filter from this datetime (Y-m-d H:i:s). |
| end_date | Filter up to this datetime (Y-m-d H:i:s). |
| sms_type | Filter by plain or unicode. |
| direction | Filter by api or outgoing. |
| timezone | IANA name the dates are interpreted and returned in, e.g. Africa/Dar_es_Salaam. Defaults to the platform timezone. |
/sms/:uid
Return one message by its uid, including the SMSC delivery receipt when the network has reported on it. A uid that belongs to another account answers 404.
Sample request
curl -X GET "https://sms.africaonesolutions.co.tz/api/v3/sms/6f1c2b8e4d5a4c3f9b7e2a1d0c9b8a76" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json"
<?php
$ch = curl_init('https://sms.africaonesolutions.co.tz/api/v3/sms/6f1c2b8e4d5a4c3f9b7e2a1d0c9b8a76');
$options = [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer YOUR_API_TOKEN',
'Accept: application/json',
],
];
curl_setopt_array($ch, $options);
$response = curl_exec($ch);
if ($response === false) {
throw new RuntimeException(curl_error($ch));
}
curl_close($ch);
echo $response;
// Node.js 18+ (global fetch)
const res = await fetch('https://sms.africaonesolutions.co.tz/api/v3/sms/6f1c2b8e4d5a4c3f9b7e2a1d0c9b8a76', {
method: 'GET',
headers: {
Authorization: 'Bearer YOUR_API_TOKEN',
Accept: 'application/json',
},
});
const data = await res.json();
console.log(data);
// Java 11+
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://sms.africaonesolutions.co.tz/api/v3/sms/6f1c2b8e4d5a4c3f9b7e2a1d0c9b8a76"))
.header("Authorization", "Bearer YOUR_API_TOKEN")
.header("Accept", "application/json")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> response =
client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
req, err := http.NewRequest("GET", "https://sms.africaonesolutions.co.tz/api/v3/sms/6f1c2b8e4d5a4c3f9b7e2a1d0c9b8a76", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")
req.Header.Set("Accept", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(out))
}
/delivery-logs
Query delivery logs with the same filters and pagination as /sms. The status parameter narrows the result to one status, for example delivered, rejected or queued.
Sample request
curl -X GET "https://sms.africaonesolutions.co.tz/api/v3/delivery-logs" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json"
<?php
$ch = curl_init('https://sms.africaonesolutions.co.tz/api/v3/delivery-logs');
$options = [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer YOUR_API_TOKEN',
'Accept: application/json',
],
];
curl_setopt_array($ch, $options);
$response = curl_exec($ch);
if ($response === false) {
throw new RuntimeException(curl_error($ch));
}
curl_close($ch);
echo $response;
// Node.js 18+ (global fetch)
const res = await fetch('https://sms.africaonesolutions.co.tz/api/v3/delivery-logs', {
method: 'GET',
headers: {
Authorization: 'Bearer YOUR_API_TOKEN',
Accept: 'application/json',
},
});
const data = await res.json();
console.log(data);
// Java 11+
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://sms.africaonesolutions.co.tz/api/v3/delivery-logs"))
.header("Authorization", "Bearer YOUR_API_TOKEN")
.header("Accept", "application/json")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> response =
client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
req, err := http.NewRequest("GET", "https://sms.africaonesolutions.co.tz/api/v3/delivery-logs", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")
req.Header.Set("Accept", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(out))
}
/delivery-logs/:uid
The delivery detail of one message: its status history and the raw receipt as the network sent it, with the submit and done times.
Sample request
curl -X GET "https://sms.africaonesolutions.co.tz/api/v3/delivery-logs/6f1c2b8e4d5a4c3f9b7e2a1d0c9b8a76" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json"
<?php
$ch = curl_init('https://sms.africaonesolutions.co.tz/api/v3/delivery-logs/6f1c2b8e4d5a4c3f9b7e2a1d0c9b8a76');
$options = [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer YOUR_API_TOKEN',
'Accept: application/json',
],
];
curl_setopt_array($ch, $options);
$response = curl_exec($ch);
if ($response === false) {
throw new RuntimeException(curl_error($ch));
}
curl_close($ch);
echo $response;
// Node.js 18+ (global fetch)
const res = await fetch('https://sms.africaonesolutions.co.tz/api/v3/delivery-logs/6f1c2b8e4d5a4c3f9b7e2a1d0c9b8a76', {
method: 'GET',
headers: {
Authorization: 'Bearer YOUR_API_TOKEN',
Accept: 'application/json',
},
});
const data = await res.json();
console.log(data);
// Java 11+
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://sms.africaonesolutions.co.tz/api/v3/delivery-logs/6f1c2b8e4d5a4c3f9b7e2a1d0c9b8a76"))
.header("Authorization", "Bearer YOUR_API_TOKEN")
.header("Accept", "application/json")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> response =
client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
req, err := http.NewRequest("GET", "https://sms.africaonesolutions.co.tz/api/v3/delivery-logs/6f1c2b8e4d5a4c3f9b7e2a1d0c9b8a76", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")
req.Header.Set("Accept", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(out))
}
/campaign/:uid/view
One campaign with its messages, so a bulk send can be followed recipient by recipient.
Sample request
curl -X GET "https://sms.africaonesolutions.co.tz/api/v3/campaign/:uid/view" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json"
<?php
$ch = curl_init('https://sms.africaonesolutions.co.tz/api/v3/campaign/:uid/view');
$options = [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer YOUR_API_TOKEN',
'Accept: application/json',
],
];
curl_setopt_array($ch, $options);
$response = curl_exec($ch);
if ($response === false) {
throw new RuntimeException(curl_error($ch));
}
curl_close($ch);
echo $response;
// Node.js 18+ (global fetch)
const res = await fetch('https://sms.africaonesolutions.co.tz/api/v3/campaign/:uid/view', {
method: 'GET',
headers: {
Authorization: 'Bearer YOUR_API_TOKEN',
Accept: 'application/json',
},
});
const data = await res.json();
console.log(data);
// Java 11+
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://sms.africaonesolutions.co.tz/api/v3/campaign/:uid/view"))
.header("Authorization", "Bearer YOUR_API_TOKEN")
.header("Accept", "application/json")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> response =
client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
req, err := http.NewRequest("GET", "https://sms.africaonesolutions.co.tz/api/v3/campaign/:uid/view", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")
req.Header.Set("Accept", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(out))
}
Message status
A message starts queued, moves through submitted or enroute, and ends delivered — or rejected, undelivered, failed, expired or deleted with the network's error code in the receipt. A status only changes when the network says so: a message with no receipt yet stays queued rather than being reported as delivered.
/contacts
Contact groups and the contacts inside them. Group identifiers are the group uid; the same uid addresses an individual contact.
Sample request
curl -X GET "https://sms.africaonesolutions.co.tz/api/v3/contacts" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json"
<?php
$ch = curl_init('https://sms.africaonesolutions.co.tz/api/v3/contacts');
$options = [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer YOUR_API_TOKEN',
'Accept: application/json',
],
];
curl_setopt_array($ch, $options);
$response = curl_exec($ch);
if ($response === false) {
throw new RuntimeException(curl_error($ch));
}
curl_close($ch);
echo $response;
// Node.js 18+ (global fetch)
const res = await fetch('https://sms.africaonesolutions.co.tz/api/v3/contacts', {
method: 'GET',
headers: {
Authorization: 'Bearer YOUR_API_TOKEN',
Accept: 'application/json',
},
});
const data = await res.json();
console.log(data);
// Java 11+
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://sms.africaonesolutions.co.tz/api/v3/contacts"))
.header("Authorization", "Bearer YOUR_API_TOKEN")
.header("Accept", "application/json")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> response =
client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
req, err := http.NewRequest("GET", "https://sms.africaonesolutions.co.tz/api/v3/contacts", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")
req.Header.Set("Accept", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(out))
}
Sample request
curl -X POST "https://sms.africaonesolutions.co.tz/api/v3/contacts" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"name":"Customers"}'
<?php
$ch = curl_init('https://sms.africaonesolutions.co.tz/api/v3/contacts');
$options = [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer YOUR_API_TOKEN',
'Accept: application/json',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => '{"name":"Customers"}',
];
curl_setopt_array($ch, $options);
$response = curl_exec($ch);
if ($response === false) {
throw new RuntimeException(curl_error($ch));
}
curl_close($ch);
echo $response;
// Node.js 18+ (global fetch)
const res = await fetch('https://sms.africaonesolutions.co.tz/api/v3/contacts', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_API_TOKEN',
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({"name":"Customers"}),
});
const data = await res.json();
console.log(data);
// Java 11+
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://sms.africaonesolutions.co.tz/api/v3/contacts"))
.header("Authorization", "Bearer YOUR_API_TOKEN")
.header("Accept", "application/json")
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\"name\":\"Customers\"}"))
.build();
HttpResponse<String> response =
client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
body := strings.NewReader(`{"name":"Customers"}`)
req, err := http.NewRequest("POST", "https://sms.africaonesolutions.co.tz/api/v3/contacts", body)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")
req.Header.Set("Accept", "application/json")
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(out))
}
Sample request
curl -X POST "https://sms.africaonesolutions.co.tz/api/v3/contacts/42/store" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"phone":"255717222303","first_name":"Amina"}'
<?php
$ch = curl_init('https://sms.africaonesolutions.co.tz/api/v3/contacts/42/store');
$options = [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer YOUR_API_TOKEN',
'Accept: application/json',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => '{"phone":"255717222303","first_name":"Amina"}',
];
curl_setopt_array($ch, $options);
$response = curl_exec($ch);
if ($response === false) {
throw new RuntimeException(curl_error($ch));
}
curl_close($ch);
echo $response;
// Node.js 18+ (global fetch)
const res = await fetch('https://sms.africaonesolutions.co.tz/api/v3/contacts/42/store', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_API_TOKEN',
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({"phone":"255717222303","first_name":"Amina"}),
});
const data = await res.json();
console.log(data);
// Java 11+
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://sms.africaonesolutions.co.tz/api/v3/contacts/42/store"))
.header("Authorization", "Bearer YOUR_API_TOKEN")
.header("Accept", "application/json")
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\"phone\":\"255717222303\",\"first_name\":\"Amina\"}"))
.build();
HttpResponse<String> response =
client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
body := strings.NewReader(`{"phone":"255717222303","first_name":"Amina"}`)
req, err := http.NewRequest("POST", "https://sms.africaonesolutions.co.tz/api/v3/contacts/42/store", body)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")
req.Header.Set("Accept", "application/json")
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(out))
}
Sample request
curl -X PATCH "https://sms.africaonesolutions.co.tz/api/v3/contacts/42/update/6f1c2b8e4d5a4c3f9b7e2a1d0c9b8a76" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"phone":"255717222303","first_name":"Amina"}'
<?php
$ch = curl_init('https://sms.africaonesolutions.co.tz/api/v3/contacts/42/update/6f1c2b8e4d5a4c3f9b7e2a1d0c9b8a76');
$options = [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer YOUR_API_TOKEN',
'Accept: application/json',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => '{"phone":"255717222303","first_name":"Amina"}',
];
curl_setopt_array($ch, $options);
$response = curl_exec($ch);
if ($response === false) {
throw new RuntimeException(curl_error($ch));
}
curl_close($ch);
echo $response;
// Node.js 18+ (global fetch)
const res = await fetch('https://sms.africaonesolutions.co.tz/api/v3/contacts/42/update/6f1c2b8e4d5a4c3f9b7e2a1d0c9b8a76', {
method: 'PATCH',
headers: {
Authorization: 'Bearer YOUR_API_TOKEN',
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({"phone":"255717222303","first_name":"Amina"}),
});
const data = await res.json();
console.log(data);
// Java 11+
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://sms.africaonesolutions.co.tz/api/v3/contacts/42/update/6f1c2b8e4d5a4c3f9b7e2a1d0c9b8a76"))
.header("Authorization", "Bearer YOUR_API_TOKEN")
.header("Accept", "application/json")
.header("Content-Type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\"phone\":\"255717222303\",\"first_name\":\"Amina\"}"))
.build();
HttpResponse<String> response =
client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
body := strings.NewReader(`{"phone":"255717222303","first_name":"Amina"}`)
req, err := http.NewRequest("PATCH", "https://sms.africaonesolutions.co.tz/api/v3/contacts/42/update/6f1c2b8e4d5a4c3f9b7e2a1d0c9b8a76", body)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")
req.Header.Set("Accept", "application/json")
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(out))
}
Sample request
curl -X DELETE "https://sms.africaonesolutions.co.tz/api/v3/contacts/42/delete/6f1c2b8e4d5a4c3f9b7e2a1d0c9b8a76" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json"
<?php
$ch = curl_init('https://sms.africaonesolutions.co.tz/api/v3/contacts/42/delete/6f1c2b8e4d5a4c3f9b7e2a1d0c9b8a76');
$options = [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer YOUR_API_TOKEN',
'Accept: application/json',
],
];
curl_setopt_array($ch, $options);
$response = curl_exec($ch);
if ($response === false) {
throw new RuntimeException(curl_error($ch));
}
curl_close($ch);
echo $response;
// Node.js 18+ (global fetch)
const res = await fetch('https://sms.africaonesolutions.co.tz/api/v3/contacts/42/delete/6f1c2b8e4d5a4c3f9b7e2a1d0c9b8a76', {
method: 'DELETE',
headers: {
Authorization: 'Bearer YOUR_API_TOKEN',
Accept: 'application/json',
},
});
const data = await res.json();
console.log(data);
// Java 11+
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://sms.africaonesolutions.co.tz/api/v3/contacts/42/delete/6f1c2b8e4d5a4c3f9b7e2a1d0c9b8a76"))
.header("Authorization", "Bearer YOUR_API_TOKEN")
.header("Accept", "application/json")
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> response =
client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
req, err := http.NewRequest("DELETE", "https://sms.africaonesolutions.co.tz/api/v3/contacts/42/delete/6f1c2b8e4d5a4c3f9b7e2a1d0c9b8a76", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")
req.Header.Set("Accept", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(out))
}
| Method | Path | Purpose |
|---|---|---|
| GET | /contacts | List contact groups. |
| POST | /contacts | Create a group. |
| POST | /contacts/:uid/show | Read one group. |
| PATCH | /contacts/:uid | Rename a group. |
| DELETE | /contacts/:uid | Delete a group. |
| POST | /contacts/:group_id/all | List the contacts inside a group. |
| POST | /contacts/:group_id/search/:uid | Find one contact in a group. |
| POST | /contacts/:group_id/store | Add a contact to a group. |
| PATCH | /contacts/:group_id/update/:uid | Update a contact in a group. |
| DELETE | /contacts/:group_id/delete/:uid | Remove a contact from a group. |
/me
Return the authenticated account: profile, timezone, locale, and the sender IDs it may use.
Sample request
curl -X GET "https://sms.africaonesolutions.co.tz/api/v3/me" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json"
<?php
$ch = curl_init('https://sms.africaonesolutions.co.tz/api/v3/me');
$options = [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer YOUR_API_TOKEN',
'Accept: application/json',
],
];
curl_setopt_array($ch, $options);
$response = curl_exec($ch);
if ($response === false) {
throw new RuntimeException(curl_error($ch));
}
curl_close($ch);
echo $response;
// Node.js 18+ (global fetch)
const res = await fetch('https://sms.africaonesolutions.co.tz/api/v3/me', {
method: 'GET',
headers: {
Authorization: 'Bearer YOUR_API_TOKEN',
Accept: 'application/json',
},
});
const data = await res.json();
console.log(data);
// Java 11+
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://sms.africaonesolutions.co.tz/api/v3/me"))
.header("Authorization", "Bearer YOUR_API_TOKEN")
.header("Accept", "application/json")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> response =
client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
req, err := http.NewRequest("GET", "https://sms.africaonesolutions.co.tz/api/v3/me", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")
req.Header.Set("Accept", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(out))
}
sender_ids is the list to choose from when calling
/sms/send or /sms/campaign: every entry there is accepted as the
sender_id field, and anything else answers 403. The list is empty when the
account has no approved sender ID yet, so an integration can check it instead of discovering the
problem on the first send.
{
"status": "success",
"message": null,
"data": {
"uid": "667b5e4de5ea4e47b37ac117ef0e28df",
"email": "you@example.com",
"locale": "en",
"timezone": "Africa/Dar_es_Salaam",
"sender_ids": ["MiaInfo", "SportPesa"]
}
}
/balance
Return the remaining SMS units and the date they expire.
Sample request
curl -X GET "https://sms.africaonesolutions.co.tz/api/v3/balance" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json"
<?php
$ch = curl_init('https://sms.africaonesolutions.co.tz/api/v3/balance');
$options = [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer YOUR_API_TOKEN',
'Accept: application/json',
],
];
curl_setopt_array($ch, $options);
$response = curl_exec($ch);
if ($response === false) {
throw new RuntimeException(curl_error($ch));
}
curl_close($ch);
echo $response;
// Node.js 18+ (global fetch)
const res = await fetch('https://sms.africaonesolutions.co.tz/api/v3/balance', {
method: 'GET',
headers: {
Authorization: 'Bearer YOUR_API_TOKEN',
Accept: 'application/json',
},
});
const data = await res.json();
console.log(data);
// Java 11+
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://sms.africaonesolutions.co.tz/api/v3/balance"))
.header("Authorization", "Bearer YOUR_API_TOKEN")
.header("Accept", "application/json")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> response =
client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
req, err := http.NewRequest("GET", "https://sms.africaonesolutions.co.tz/api/v3/balance", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")
req.Header.Set("Accept", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(out))
}
/ping
Confirm the key works and the API is reachable. This is the cheapest endpoint to call from a health check.
Sample request
curl -X GET "https://sms.africaonesolutions.co.tz/api/v3/ping" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json"
<?php
$ch = curl_init('https://sms.africaonesolutions.co.tz/api/v3/ping');
$options = [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer YOUR_API_TOKEN',
'Accept: application/json',
],
];
curl_setopt_array($ch, $options);
$response = curl_exec($ch);
if ($response === false) {
throw new RuntimeException(curl_error($ch));
}
curl_close($ch);
echo $response;
// Node.js 18+ (global fetch)
const res = await fetch('https://sms.africaonesolutions.co.tz/api/v3/ping', {
method: 'GET',
headers: {
Authorization: 'Bearer YOUR_API_TOKEN',
Accept: 'application/json',
},
});
const data = await res.json();
console.log(data);
// Java 11+
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://sms.africaonesolutions.co.tz/api/v3/ping"))
.header("Authorization", "Bearer YOUR_API_TOKEN")
.header("Accept", "application/json")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> response =
client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
req, err := http.NewRequest("GET", "https://sms.africaonesolutions.co.tz/api/v3/ping", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")
req.Header.Set("Accept", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(out))
}
Keeping your keys safe
Anyone holding a key can send from your balance, so treat it like a password and never put it in a public repository or a browser-side script. Generate a separate key per system, so one can be revoked without disturbing the others.
A key is shown once when it is created; only a hash is stored and it cannot be displayed again. Lost keys are replaced, not recovered.