The SemaLink API, v1
One simple API for SMS to Safaricom, Airtel and Telkom. Build for free in the sandbox, then go live at KES 0.80 a message, with a delivery report for every phone.
New to SemaLink? Create a free account. Your sandbox keys work straight away.
Code first
POST a number, your sender ID and the text. SemaLink answers 202 Accepted with the message, already on its way, and tells you by webhook when it's delivered.
Request
curl https://api.semalink.africa/v1/messages \
-H "Authorization: Bearer $SEMALINK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "+254712345678",
"from": "GREENHILL",
"text": "Your order GH-1042 is ready."
}'const url = 'https://api.semalink.africa/v1/messages';
const response = await fetch(url, {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SEMALINK_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
to: '+254712345678',
from: 'GREENHILL',
text: 'Your order GH-1042 is ready.',
}),
});
const message = await response.json();import os
import requests
key = os.environ["SEMALINK_API_KEY"]
response = requests.post(
"https://api.semalink.africa/v1/messages",
headers={"Authorization": f"Bearer {key}"},
json={
"to": "+254712345678",
"from": "GREENHILL",
"text": "Your order GH-1042 is ready.",
},
timeout=30,
)
message = response.json()<?php
$key = getenv('SEMALINK_API_KEY');
$ch = curl_init('https://api.semalink.africa/v1/messages');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer $key",
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'to' => '+254712345678',
'from' => 'GREENHILL',
'text' => 'Your order GH-1042 is ready.',
]),
]);
$message = json_decode(curl_exec($ch), true);202 Accepted
{
"id": "msg_3b9f6c2a1d4e4f5a8b7c6d5e4f3a2b1c",
"object": "message",
"livemode": true,
"to": "+254712345678",
"from": "GREENHILL",
"text": "Your order GH-1042 is ready.",
"status": "queued",
"network": "safaricom",
"parts": 1,
"cost": {
"amount": 80,
"currency": "KES",
"display": "KES 0.80"
}
}The response is shortened: it's the whole message object. Next: try it in the sandbox, or read Sending messages.
About five minutes
Everything starts in the sandbox: real API calls, simulated phones, no money spent.
Sign up for free. Sandbox keys work from day one, while we verify your business and approve your sender ID.
Create an accountIn the dashboard, open Developer and create a test key. It starts with sk_test_ and only ever reaches the sandbox.
Open DeveloperSend to a sandbox number, then watch it go from queued to delivered by webhook or by asking the API.
Follow the quickstartThe docs
Create a free account, take a test key and send your first sandbox message today. Live keys follow once your business is verified.