USSD simulator
curl --request POST \
--url https://ussdsim.beem.africa/ \
--header 'Content-Type: application/json' \
--data '
{
"operator": "tigotz",
"msisdn": "255712444555",
"callbackUrl": "https://your-app.example.com/ussd/callback"
}
'import requests
url = "https://ussdsim.beem.africa/"
payload = {
"operator": "tigotz",
"msisdn": "255712444555",
"callbackUrl": "https://your-app.example.com/ussd/callback"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
operator: 'tigotz',
msisdn: '255712444555',
callbackUrl: 'https://your-app.example.com/ussd/callback'
})
};
fetch('https://ussdsim.beem.africa/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://ussdsim.beem.africa/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'operator' => 'tigotz',
'msisdn' => '255712444555',
'callbackUrl' => 'https://your-app.example.com/ussd/callback'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://ussdsim.beem.africa/"
payload := strings.NewReader("{\n \"operator\": \"tigotz\",\n \"msisdn\": \"255712444555\",\n \"callbackUrl\": \"https://your-app.example.com/ussd/callback\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://ussdsim.beem.africa/")
.header("Content-Type", "application/json")
.body("{\n \"operator\": \"tigotz\",\n \"msisdn\": \"255712444555\",\n \"callbackUrl\": \"https://your-app.example.com/ussd/callback\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://ussdsim.beem.africa/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"operator\": \"tigotz\",\n \"msisdn\": \"255712444555\",\n \"callbackUrl\": \"https://your-app.example.com/ussd/callback\"\n}"
response = http.request(request)
puts response.read_body{
"msisdn": "2556730893370",
"operator": "vodacom",
"session_id": "33545",
"command": "continue",
"payload": {
"request_id": "1",
"request": "enter amount"
}
}USSD
USSD simulator
Test your USSD callback with the Beem sandbox simulator.
POST
/
USSD simulator
curl --request POST \
--url https://ussdsim.beem.africa/ \
--header 'Content-Type: application/json' \
--data '
{
"operator": "tigotz",
"msisdn": "255712444555",
"callbackUrl": "https://your-app.example.com/ussd/callback"
}
'import requests
url = "https://ussdsim.beem.africa/"
payload = {
"operator": "tigotz",
"msisdn": "255712444555",
"callbackUrl": "https://your-app.example.com/ussd/callback"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
operator: 'tigotz',
msisdn: '255712444555',
callbackUrl: 'https://your-app.example.com/ussd/callback'
})
};
fetch('https://ussdsim.beem.africa/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://ussdsim.beem.africa/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'operator' => 'tigotz',
'msisdn' => '255712444555',
'callbackUrl' => 'https://your-app.example.com/ussd/callback'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://ussdsim.beem.africa/"
payload := strings.NewReader("{\n \"operator\": \"tigotz\",\n \"msisdn\": \"255712444555\",\n \"callbackUrl\": \"https://your-app.example.com/ussd/callback\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://ussdsim.beem.africa/")
.header("Content-Type", "application/json")
.body("{\n \"operator\": \"tigotz\",\n \"msisdn\": \"255712444555\",\n \"callbackUrl\": \"https://your-app.example.com/ussd/callback\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://ussdsim.beem.africa/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"operator\": \"tigotz\",\n \"msisdn\": \"255712444555\",\n \"callbackUrl\": \"https://your-app.example.com/ussd/callback\"\n}"
response = http.request(request)
puts response.read_body{
"msisdn": "2556730893370",
"operator": "vodacom",
"session_id": "33545",
"command": "continue",
"payload": {
"request_id": "1",
"request": "enter amount"
}
}Your callback URL must be publicly reachable over HTTPS. The simulator forwards each request to your endpoint via
https://ussdsim.beem.africa/.How to use
1
Set the three body fields
Enter operator, msisdn, and callbackUrl, then click Try it.
2
Verify your handler
Confirm your callback returns the next menu prompt with HTTP 200.
Related
- USSD callback — implement your handler
- Receive USSD session callback — production callback format
Body
application/json
Mobile network operator to simulate.
Available options:
tigotz Example:
"tigotz"
Subscriber phone number (12 digits, e.g. 255712444555).
Example:
"255712444555"
Your publicly accessible USSD callback endpoint (HTTPS).
Example:
"https://your-app.example.com/ussd/callback"
Response
200 - application/json
Response from your callback handler
Echo the subscriber mobile number.
Echo the operator.
Echo the session ID.
Next session command Beem should apply.
Available options:
initiate, continue, terminate Show child attributes
Show child attributes
