curl --request POST \
--url https://example.com/callback \
--header 'Content-Type: application/json' \
--data '
{
"command": "initiate",
"msisdn": "255762089337",
"session_id": "4574",
"operator": "vodacom",
"payload": {
"request_id": 0,
"response": 0
}
}
'{
"msisdn": "2556730893370",
"operator": "vodacom",
"session_id": "33545",
"command": "continue",
"payload": {
"request_id": "1",
"request": "enter amount"
}
}API Reference
Receive USSD session callback
Webhook your application must implement. When a subscriber dials your USSD code, Beem POSTs session events (initiate, continue, terminate) to the callback URL configured in the Beem dashboard. Respond with the next menu prompt. Replace the server URL with your own HTTPS endpoint.
POST
/
callback
curl --request POST \
--url https://example.com/callback \
--header 'Content-Type: application/json' \
--data '
{
"command": "initiate",
"msisdn": "255762089337",
"session_id": "4574",
"operator": "vodacom",
"payload": {
"request_id": 0,
"response": 0
}
}
'{
"msisdn": "2556730893370",
"operator": "vodacom",
"session_id": "33545",
"command": "continue",
"payload": {
"request_id": "1",
"request": "enter amount"
}
}Body
application/json
Session phase: initiate (first dial), continue (ongoing), or terminate (close session).
Available options:
initiate, continue, terminate Subscriber mobile number.
Mobile network operator, e.g. vodacom, tigo, airtel, halotel, ttcl.
Unique session identifier for the USSD transaction.
Show child attributes
Show child attributes
Response
200 - application/json
Return the next USSD menu or session termination prompt
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
