Developers
USSD, Airtime & Data

USSD

OfficeUG can answer a USSD code through Africa's Talking. You connect your account, build a menu, and point your USSD code at OfficeUG.

Connect it

  1. Save your Africa's Talking username and API key under Settings → Africa's Talking.
  2. Turn on USSD and build your menu on the same page.
  3. Copy the USSD callback URL from that page. It looks like https://officeug.com/africastalking/ussd/{company_slug}.
  4. In the Africa's Talking dashboard, open your USSD code and paste it as the Callback URL.

Copy the URL from your own settings page. If you protect your callbacks, that URL also includes your webhook username and password.

What Africa's Talking sends

Each step of a session is a POST with these form fields:

Field Meaning
sessionId Identifies this USSD session.
serviceCode The code that was dialled.
phoneNumber The caller's number.
text Everything the caller has entered so far, separated by *. Empty on the first step.

What OfficeUG replies

The reply is plain text. The first word tells the network what to do next:

Starts with Meaning
CON Show this message and wait for the caller's input.
END Show this message and close the session.
CON Welcome to Example SACCO
1. Check balance
2. Mini statement

Session events

You can also receive a report when each session ends. Copy the USSD events URL from settings into the Africa's Talking dashboard. It looks like this:

https://officeug.com/africastalking/ussd/{company_slug}/events

Testing the URL

Opening either URL in a browser shows a short message confirming the endpoint exists. Real sessions only work through POST from Africa's Talking.