Overview
The SMS service provides endpoints for sending bulk SMS, two-way SMS, and handling various SMS-related callbacks including delivery reports, opt-outs, and subscription notifications.GET /sms/
Check SMS service status.Response
Service name (“sms”)
Service status (“ready”)
Example Request
Example Response
GET /sms/invoke-bulk-sms
Send a bulk SMS to a phone number.Query Parameters
Phone number to send SMS to (without the + prefix, e.g., 2547XXXXXXX)
Message content to send
Response
Success message indicating SMS was sent
Response object from Africa’s Talking API
Example Request
Example Response
Error Codes
- 400 - Missing ‘phone’ query parameter
- 500 - Internal server error or Africa’s Talking API error
GET /sms/invoke-twoway-sms
Send a two-way SMS to a phone number.Query Parameters
Phone number to send SMS to (without the + prefix, e.g., 2547XXXXXXX)
Message content to send
Response
Success message indicating SMS was sent
Response object from Africa’s Talking API
Example Request
Example Response
Error Codes
- 400 - Missing ‘phone’ query parameter
- 500 - Internal server error or Africa’s Talking API error
POST /sms/twoway
Webhook callback for receiving two-way SMS messages from Africa’s Talking.Request Body (Form Data)
Link ID connecting this incoming message to a previous outbound message
The message text received from the user
The shortcode or phone number the message was sent to
Unique message ID
Timestamp of when the message was received
Phone number of the sender
Response
Returns “GOOD” with status 200 on success, or “BAD” with status 400 if required fields are missing.Example Request
Example Response
Error Codes
- 400 - Missing required fields (linkId, text, to, id, date, or from)
POST /sms/delivery-reports
Webhook callback for SMS delivery reports from Africa’s Talking.Request Body (Form Data)
Message ID of the SMS
Delivery status (e.g., “Success”, “Failed”)
Phone number the SMS was sent to
Mobile network code
Reason for failure (if status is “Failed”)
Number of retry attempts
Response
Returns “OK” with status 200.Example Request
Example Response
POST /sms/opt-out
Webhook callback for bulk SMS opt-out notifications from Africa’s Talking.Request Body (Form Data)
Sender ID (brand name) that the user opted out from
Phone number that opted out
Response
Returns “OK” with status 200.Example Request
Example Response
POST /sms/subscription
Webhook callback for premium SMS subscription notifications from Africa’s Talking.Request Body (Form Data)
Phone number that subscribed or unsubscribed
Short code associated with the subscription
Keyword for the subscription (e.g., “NEWS”, “ALERTS”)
Type of update: “addition” (subscribed) or “deletion” (unsubscribed)
