Developers
USSD, Airtime & Data

Securing Callbacks

Africa's Talking doesn't sign its USSD, airtime or data callbacks. To prove a callback really came from your account, OfficeUG uses HTTP Basic Authentication with a username and password that you choose.

Turn it on

  1. Open Settings → Africa's Talking.
  2. Enter a Webhook Username and a long, random Webhook Password, then save.
  3. The callback URLs on that page now include those details, like https://username:[email protected]/africastalking/airtime/{company_slug}/status.
  4. Paste each updated URL into your Africa's Talking dashboard, replacing the old one.

Do this straight after saving. Callbacks that still use the old URL are refused until you update them.

What happens to each callback

Callback Without a webhook password With a webhook password
USSD and session events Accepted Only accepted with the right credentials
Airtime and data validation Accepted Only accepted with the right credentials
Airtime and data status Always refused Only accepted with the right credentials

Status callbacks can trigger refunds, so they always need a password.

When a callback is refused

So that Africa's Talking handles it cleanly, a refused callback still returns HTTP 200, with the normal "no" reply for that callback:

Callback Reply
USSD END Service temporarily unavailable.
USSD events, status OK
Validation { "status": "Failed" }

Check your stored credentials if you see these replies when you expected success.

Keep sending these callbacks as normal form or JSON data. File uploads to these endpoints are blocked.