Get Started

To effectively utilize the USSD API, follow these steps:

  1. Begin by registering a shortcode with us.

  2. Share your webhook with us. This webhook acts as a callback mechanism, triggered by an incoming user request with the registered shortcode. Whenever such a request is received on our platform, we will make an HTTP POST request to your provided webhook. The payload sent to your webhook will contain the request data in JSON format (Content-Type: application/json). Here's an example of a sample payload:

{
  "shortcode": "165",
  "msisdn": "256756070595",  
  "mccmnc":"64101",
  "sessionid": "50b1be9cb6a90",
  "state": "START",
  "message": "1"
}
  1. Your server should respond with the desired message to be displayed on the user's handset in JSON format (Content-Type: application/json). The response should include the same payload structure as the received request, with an updated state. Here's an example of an expected response from your server:

{
  "msisdn": "256756070595",
  "sessionid": "50b1be9cb6a90",
  "state": "CONTINUE",
  "message": "Hello world. Welcome to LTD"
}

The USSD API operates with three different states:

  • START: This state is sent when a new session is initiated by the user.

  • CONTINUE: Your server should respond with this state if you wish to continue the session.

  • END: Your server should respond with this state if you want to terminate the session.

  1. It's important to note that every request we send you will include a sessionid, which should be maintained and used until the session is completed.

  2. Avoid including special characters in your USSD Menu to ensure seamless access to your USSD services. Telcos may encounter difficulties in rendering content with special characters, potentially causing disruptions in the user's ability to utilize your USSD services.

  3. Payloads are signed using public-key cryptography to guarantee the authenticity of delivered callbacks. Each callback delivery request includes a Signature header field. This field contains a base64-encoded RSA PKCS#1 v1.5 signature of the SHA256 digest of the request body buffer.

Last updated