USSD app



You’ve heard of Africastalking, but did you know you can build a functional USSD app with simple if else programming knowledge?

It’s free-ish too…




Africastalking USSD simulator
First of all, big shout out to Devcenter. I think they don’t get enough credit for their contributions to the developer ecosystem in Nigeria. Asides the high-end freelance gigs I get from them occasionally, I’m most thankful for the $100 AWS promo code they shared last year on their slack channel, with it, I was able to explore AWS, and I’m now familiar with S3, EC2, SES, Cloudfront, and RDS, all of which is used by Selar.co today.
Seun(COO of Devcenter) invited me for a small sit down with the Africa’s Talking team yesterday, where we had a hands-on session with their api, and they showcased what developers can achieve with their API.


Services they offer(africastalking.com)

In layman terms, here’s what they can do for you
SMS: Send SMS globally and receive SMS from mobile numbers across Africa with sms short codes.
USSD: Setup your own USSD code(something like *384*1300#), and link it to your web application.
Voice: You know that stuff that happens when you call MTN customer care and a voice speaks, and you dial a number on your key pad, and stuff happens bla bla bla? Yes, that’s what this is for. Plus, it’s very flexible.
Payments: Mobile money, card and bank payments (powered by Flutterwave)
Airtime: Airtime and data recharge APIs (powered by Flutterwave).

THE USSD

Of all the awesome services they offer, I am totally in awe of USSD. Mainly because USSD is the new FAD in Nigeria that has this “Too complicated to even try” vibe , plus I remember my first dig at USSD sometime this year, and it was a mess. Having the Africa’s Talking team make this available to the general public in such a seamless way is great, and I think the timing is right too! Now, developers can be creative with it, and do amazing things.

Here’s how to setup your USSD application in 4 steps(maybe not four)

Step 1: Create an account on Africastalking.com
Step 2: Click the “Go to Sandbox App” button on your dashboard

Sandbox Dashboard showing all the services they offer on the menu

Step 3: Click the USSD menu item to see the dropdown, and select the “Create Channel” option.


The USSD code format for their Nigerian USSD is
*384*YOUR CHANNEL NO#
So your USSD code would look like this *384*1300#
The callback URL is the server side endpoint that the USSD application would call every time a user dials your USSD code(That’s where you’ll have your If else code).
Step 4: create your USSD channel, and use it.
They already provide a sample, so here’s a simple PHP code snippet of how you can model your code. The values are gotten via POST, so you can use your language specific code get the values with their specific keys. The user’s input will be stored in the text POST variable, so you can alternate the view shown, and perform actions based on that. They also pass the user’s phone number so you can use that for your database records, and identification of users.
You may need to take a minute or two to look at the code to fully understand it, but this is by far, the easiest USSD implementation out there.


You can also get more clarity from their official documentation http://docs.africastalking.com/ussd . Feel free to use this snippet to play around on your own setup.





They also have a Simulator too!

Life is always easy when one can test what they’re developing, and they were thorough enough to make an awesome simulator for all their services.
Link: https://simulator.africastalking.com:1517/ You can try my demo USSD application with *384*1300#
Now, for what you’ve been eager to know... PRICING!
While they said they have no “setup” cost, you’ll be charged NGN 20,000 monthly for each live USSD code. And that’s not all, each session(whenever a user dials your USSD code), it would cost NGN 3. However, this NGN 3 charge can be passed to the customer, and if the customer doesn’t have sufficient airtime, they won’t be able to access the USSD code. And of course, you(application owner) can incur the NGN 3 charge for each session, it all depends on your use-case, and what you want.
That being said, I did drop my 2 cents on the pricing at session; Obviously not discounting the fact that they’re doing a great deal by making such a “closely guarded” service available to the public for only NGN 20,000 a month, I just had to mention that, NGN 20,000 monthly is a high bar for some developers that just want to play with the api to produce greatness, and in my opinion, NGN 5,000 monthly seemed do-able, especially for start-ups that are just looking for ways to make their customers life easier with USSD. Samuel(CEO of Africa’s Talking) said he’ll relay that to his commercial team and they’ll see what they can do — let’s hope that turns out to be positive.

Summary

I love what they have now, I think it’s sufficient for a start. The team seems very passionate about what they’re doing, and they have so much exciting plans for the future. They also mentioned they’re partnering with Flutterwave to make USSD payments with Nigerian banks available soon, so we can keep our fingers crossed for that.
Ps: Their USSD code is only available on MTN and 9Mobile currently, they said Glo is coming very soon(in a month, I think…), and Airtel would follow.

Useful links:




  • Douglas Kendyson

    Medium member since Apr 2019
    Full-stack developer…and I also “passively” manage Selar.co(Africa’s shopify/gumroad). kendyson@kendyson.com






  • Responses



  • Devcenter Square Blog
    Never miss a story from Devcenter Square Blog, when you sign up for Medium. Learn more




  • Popular posts from this blog

    How to Write Exams

    Virus That Steals Facebook Passwords