In this video, I show a typical developer workflow for using Africa's talking API to respond to incoming text messsges sent to a shortcode. In the end of this video, we will have build an SMS responce from scratch using Flask (a python server). This video is only lightly edited but generally reflects what the development experience is like working with Africa's talking API, their developer tools, and debugging a flask server.
0:00 - Introduction. Context, and motivations for using Africa's Talking for SMS. Why Africa's Talking over Twilio?
1:00 - Quick blurb about the use case for USSD and feature phones
1:25 - Demo of what we're doing to go, where a user sends an SMS is sent to a short code, the server will respond with whatever the user texted the short code. (Sorta like a mime!)
2:00 - Sandbox -- After setting up an account on Africa's talking platform, this sandbox is available.
3:51 - Shortcode set up and callbacks -- Having Africa's Talking hit an endpoint on our server. I show where you configure that on the platform.
5:40 - Flask server set up (Python) - A server that can receive and send texts.
8:59 - Adding a POST route for the callback and setting up ngrok.
10:55 - Testing whether the server receives a POST request, and seeing what data is in the request.
12:25 - Using Insomnia to debug the POST endpoint
13:30 - More debugging, trying to figure out how to use `requests` in python. This actually took me around 10 minutes to figure out the right field on the request object that contains the payload I want. I also end up changing the response to return `201` because I realized that I have to hit a separate API in order to send a text message back.
21:03 - Sending an SMS back to the user
21:40 - Getting an API key
23:24 - Looking at Africa's Talking documentation for SMS request.
23:40 - Replicating the CURL request from the docs in python.
28:20 - Figure out what the fields are for phone number and text.
30:30 - Updating the logic to reply with the same text the user sent.
31:01 - Outro