
Explore building and testing USSD and SMS applications, learn to design and navigate interactive menus, and connect to mobile networks, designed for absolute beginners.
Explore a five-chapter course outline covering USSD and SMS, GSM network integration, building a mobile money app, and tools like Postman and curl for testing and deployment.
Discover essential tools for building and testing USSD and SMS apps, including a database-backed web server, Visual Studio Code, Postman, and ngrok; learn API integration and HTTP protocol structure.
Explore how USSD and SMS apps are assessed, built, and submitted, compare SMIs with us, and examine architecture, components, and their relation to the GSM network.
Explore USSD signaling between mobile stations and gateways, including push and pull service models. Identify dedicated versus shared user codes, channel differentiation, and real time nature of mobile terminated messages.
Understand USSD, a real-time, menu-driven service on GSM networks that uses dial codes. Compare USSD with SMS, noting real-time delivery, accessibility on any phone, and character limits.
Explore sms types, including normal user-to-user messages, four to five digit short codes for mass texting, dedicated versus shared shortcodes with keywords, and branded one-way messages appearing from a name.
Explore three options for building USSD apps: your own gateway, telco access, or a third-party aggregator. Show how a USSD aggregator with a REST API reaches mobile networks.
Explore USSD session length, customer response time, and application response time out, and how network carrier limits (up to 180 seconds) and vendor variances shape robust app design.
Explore the real-time, menu-driven benefits of USSD applications, including cross-device accessibility and roaming support, and examine drawbacks such as fixed interfaces, timeouts, non-saved messages, and security concerns.
Identify two main USSD app uses: operator services such as airtime loading, balance checks, please call me, and data plan subscriptions, alongside value added services for mobile banking and marketing.
Build a simple mobile money app with registration, sending money, checking balance, and withdrawals via registered agents, using USSD or shortcode and PIN verification.
chapter 3 preview introduces the language used to develop the application and nudges readers to review the chapter outline before proceeding.
Install and start XAMPP to set up the Apache web server and MySQL DBMS on your local machine, then verify the local host interface and database access.
Set up Postman on Windows, install Postman Agent, and log in to launch the web interface for testing http requests against your local server.
Explains PHP data types — string, integer, float, boolean, array, object, null, resource — declares a dollar-sign variable and notes dynamic typing with post, get, session.
Explore PHP functions by comparing user defined and inbuilt functions, explain parameterized and non parameterized forms, and illustrate defining, calling, and returning values.
Learn how the PHP substr function returns portions of a string using a start index and optional length, with phone number and concatenation examples.
Learn the built-in string replace function, which swaps characters in a string using what to replace, what to replace with, and an optional count, with a hash-to-asterisk example.
Learn how the php explode function splits a string into an array using a separator, returning the data as an array. See how to extract numbers and test with postman.
Demonstrate the PHP array_shift function, which removes the first array element and returns it, showing how explode converts a string to an array and how shifting affects the result.
Discover how the PHP count function measures the number of elements in an array and determines the array's size.
Explore PHP functions with array_slice to fetch a part of an array by specifying start index, length, and an option to preserve keys, illustrated by practical examples.
Explore how PHP merges multiple arrays into a single array using the array_merge function, combining elements from each input array into one result.
Learn how the PHP join function merges array elements into a string using a separator, or glue. See an example where an array becomes 3*6*3*0*6*4 with an asterisk.
Explore the PHP array_search function to find the first key for a given value in an array, and understand strict mode and default false behavior.
Explore how the PHP function unset removes an array element by index, illustrated by deleting index 2 from a five-element array to yield a four-element result.
discover how php’s array_splice removes elements from an array and can replace them with an array or element; if no replacement is provided, elements are removed and indices reindex.
Explore how GET and POST HTTP methods pass data to PHP, using name and age as parameters, with GET in the query and POST in the body.
Explore object oriented programming with a PHP class: a string member and a constructor, plus methods to remove 99 or 98, returning rest joined by an asterisk; verify with postman.
Explore object oriented programming in PHP by implementing a remove ninety-eight function using classes, member variables, and methods, and test it through iterative array manipulation.
Connect to a MySQL database with PHP PDO using prepared statements and a database handle, and handle errors. Manage transactions with commit and rollback, and read results as associative arrays.
Explore how PHP's password_hash and password_verify secure passwords, store them as hashes rather than plain text, and resist rainbow table attacks with salt and hashing algorithms.
Learn the HTTP protocol structure, including requests, responses, methods, headers, and bodies, and how status codes like 200, 404, and 500 guide client-server interactions.
Explore how to design and develop USSD menus within a mobile application, and preview testing methods to ensure intuitive, reliable menu flows.
Evaluate costs, maintenance, revenue sharing, and payment terms when choosing a USSD gateway aggregator. Compare telco coverage, services, API documentation, developer support, and sandbox access to ensure startup-friendly integration.
Design and test a USSD app with a multi-level menu for register, send money, and check balance, including pin, receiver, amount, and confirm or cancel, plus 98/99 navigation.
Design a USSD/SMS app database by outlining entities like user, agent, and transaction, detailing relationships, attributes, and a MySQL-compatible schema for implementation.
design a transaction table with an auto incremented primary key transaction_id, amount, sender user_id, receiver_id, agent_id, transaction_type, and completed_on, with agent_id or receiver_id nullable depending on send or withdraw.
Set up ngrok to securely expose your local development server to the internet, test APIs with a public URL, and monitor requests via its graphical user interface, without deploying code.
Explore the ussd gateway aggregator and its developer resources, simulator, and sample code for building and testing ussd and sms apps.
Create the entry point for the USSD and SMS app by adding an index.php file and generating a public callback URL to expose the local server.
Learn to create a USSD service code and add a callback URL in a sandbox, create a channel, and test wiring with sample code using the docs.
Test your first USSD application using the provided sample code, configure the service and call order, and run a mobile simulator to interact with the USSD menu.
Understand the code for your first USSD application, including how the gateway posts data via HTTP, and how station ID, service code, number, and text drive menu decisions.
Learn to track USSD sessions on the aggregate US platform, identify completed, incomplete, and failed sessions, and use detailed error messages to diagnose why a request did not process.
Restructure the app entry point and introduce a menu class to route USSD interactions by user registration and session, providing register options for new users and menus for registered users.
Build the USSD main menu for registered and unregistered users with options to send money, withdraw, and check balance, and prepare response handling for CON prompts.
Analyze the USSD entry point by parsing user replies with explode on asterisk separators, then route via switch to register, send money, withdraw, or check balance, with invalid choice handling.
Test the USSD register menu using the simulator, entering name and pin, validating pin confirmation, and confirming registration while noting security concerns and next steps to connect to a database.
Create a util.php constants class with static variables for navigation codes like 98 for go back and 99 for main menu, and include this file in the project.
Build a multi-stage send money menu that guides registered users through entering the receiver's mobile number, amount, and pin, with authentication and confirm or cancel options.
Testing the send money menu logic in a USSD app, the lecture demonstrates verifying registered users, input flows (service code, mobile number, amount, PIN), and handling server errors before confirmation.
Develop and test the withdraw money menu for a ussd and sms app by guiding users through levels to enter amount and pin, then confirm or cancel.
Test the USSD withdraw menu logic using the simulator, enter option digits 2, 3, 4, then the pin and confirm, noting that the request processing logic is not implemented yet.
Complete the check balance menu with a level-based flow that prompts for a pin after selecting check balance, and indicate processing while handling invalid inputs.
Test the USSD check balance flow in the simulator by entering the code and pin, selecting check balance, and sending; you then receive an SMS.
Test USSD menus locally with Postman by sending POST requests that mimic user input, including text, phone number, session codes, and menu replies, avoiding timeouts.
Implement a bug fix for the main menu navigation in a USSD and SMS app by using a middleware to clean text and manage go back and main menu entries.
Implement go-to-main-menu logic for a USSD flow by parsing user input, detecting 99 as back-to-start, slicing the history array, and joining results for display and testing.
Develop and refine a go-back flow in a USSD menu by removing the 98 option and the preceding entry, updating array handling to reflect history, and preparing for testing.
Test middleware and navigate between the main menu and back options using Postman, entering mobile numbers, amounts with an asterisk, and pins while observing 182-character message limits.
Learn to design USSD and sms menus with a finite state machine, defining fixed states, inputs, and transitions to simplify menu changes and maintenance.
Link the application logic to the USSD business menus and connect the app to the database, previewing the chapter on building and testing USSD and SMS applications.
Establish a local database connection for your USSD and SMS app by configuring a MySQL database on localhost, creating and importing the user table schema, and testing with Postman.
Design a user class to encapsulate user data and operations for a ussd and sms app, including name, phone, pin, and balance, with constructors, setters, getters, and registration logic.
Complete the user registration flow by hashing the pin and inserting the name, phone, and balance with prepared statements, then verify the user is registered to show their name.
Wire the user class to the USSD menu, create a user object, connect to the database, then register or read the user using isRegistered checks and a register method.
Test end-to-end user registration via a postman post to the app. Validate parameters and confirm a hashed pin, balance, and a menu with send money, withdraw, and check balance.
Learn how to handle invalid menu choices in USSD and SMS apps by looping back to the same menu and allowing retries instead of ending the session.
Adjust the USSD flow to return the menu string for a registered user instead of echoing, handle invalid options by replaying the menu and logging the invalid choice.
Persist invalid USSD inputs by tracking the input level and using a persist invalid function to store session, user id, and level in the USSD decision table.
Learn to remove invalid menu options from a user's USSD string by querying invalid entries, filtering them, rebuilding the string, and returning to the main menu via middleware.
Identify and implement invalid input handling across multiple menu locations using the middleware and the invalidEntry function, persisting invalid entries to the database.
Complete the user pin verification and balance retrieval logic by querying the database with the phone number, using prepared statements and password verify to ensure correct pin and fetch balance.
Use in-memory databases like Redis or Memcache to store invalid menu options for faster response times, while balancing memory usage versus disk-persisted options.
Add the country code to a local receiver phone number to convert it into international format by dropping the leading zero and appending the country code using a substring.
Build a transactions class to encapsulate the USSD/SMS transfer logic, including amount and transaction type, with a constructor and methods for send money and withdraw cash.
Learn to implement the send money function by updating user balances and logging transactions in the transactions table, using a transactional approach with begin, prepare, execute, and commit or rollback.
Wire the send money logic into the send money menu for a USSD/SMS app. Validate sender and receiver, assemble PDU data, and execute the transaction end-to-end.
Debug a runtime syntax error in a USSD/SMS workflow by simplifying middleware, removing unnecessary user id checks, and using the decision id to guide responses.
This lecture demonstrates end-to-end testing of a send money feature, including registering a new user Mary, setting a pin, confirming the transaction, and verifying updated balances and transaction records.
Wire the check balance logic to the check balance menu by validating the PIN and retrieving the wallet balance from the database, then optionally send an SMS with the balance.
Test the check balance functionality for a registered user named John, entering the pin 1 2 3 4, and confirming that the wallet balance displays correctly.
Withdraw cash by confirming an agent's details and using the interface to select the agent id to dispense the cash.
Examine the agent class structure, with name and agent number as members and a constructor to initialize them, plus methods to read a name by number and the agent ID.
implement withdraw cash logic by logging the transaction and updating the user balance, using a transaction to commit or roll back on errors.
Wire the withdraw cash logic to the withdraw cash menu in a USSD and SMS app, validating the agent and pin, checking balance, and processing the transaction.
Test the withdraw feature in a USSD/SMS app by simulating a user withdrawal, validating balance deduction, agent interaction, PIN checks, and transaction logging.
Test the USSD and SMS withdrawal flow using the simulator to verify balance reduction, transaction recording, and that Postman tests align with simulator results.
Discover how USSD notifications work by configuring a callback URL to receive post requests with status, date, duration, cost, and error messages, and learn when to enable event callbacks.
Implement a USSD notifications feature by wiring a callback URL to the server, processing incoming post data, and saving it to the notification table, while highlighting plaintext PIN security risks.
Learn how to assimilate text messaging functionality into your application and how to send branded premium messages.
Explore the gateway's sms and ussd features, including inbox, message status, premium subscription products, shortcode and alphanumeric branding, callbacks, delivery reports, opt-out, and subscription notifications.
Explore how to receive an incoming message to a shortcode, register a callback, and understand notification data such as date, time, phone number, and text message.
Learn to create and manage a shortcode for USSD and SMS apps, choosing a four to five digit number in a sandbox and testing availability with gateway providers.
Set a callback url to receive incoming messages from the gateway. Create a server script to handle the post message when a message arrives.
The system receives sms data from the gateway via post, extracts the sender's phone number and text, parses name and pin, and registers the user in the database.
Test user registration via sms shortcode by sending a name and password to shortcode 3322. Verify the new user appears in the database, then repeat with shortcode 45459.
Learn how users registered via sms can still access wallet balance by using ussd, entering the service code and pin to query balance.
Test your callback url script with Postman by sending a post request with form data, including text and mobile number, before linking to simulator, then verify data in the database.
Explore how to send an SMS to a short code via the API, with sandbox and live endpoints, post requests, and key request parameters.
Learn to send an sms from a shortcut to a user’s mobile using postman in sandbox, with the sandbox username, recipient number, message, and shortcode 3322.
Explore the gateway sdks, install the sdk for languages like php and java, instantiate the gateway, and send sms via the sms service while managing content subscriptions.
Install composer, the application level package manager for dependencies, on Windows using the Windows installer. Verify the installation with composer --version, and prepare for next lesson on installing sdk.
Install the AT PHP SDK with composer, and use the composer install command to fetch packages, preparing the project to send SMS via the SDK.
Design a dedicated sms sender class that uses an sdk service to send messages. Initialize with username and api key, manage recipient phone and shortcode, expose a send sms method.
Wire the USSD balance check to send an SMS with the user's wallet balance. Build the message, dispatch it via shortcode, and handle success or error responses.
Test the flow for sending a user wallet balance as sms from a short code, including checking balance with a pin and delivering inbox messages for later reference.
Configure the branded sms sender by replacing short codes with the company name, enable the U.S. gateway, and send wallet balance updates while including opt-out instructions.
Send bulky sms to multiple recipients by configuring a recipient list, fetching phone numbers, and broadcasting from an admin page, then test with multiple simulators.
Demonstrate two-way sms communication using a short code by registering a user via an incoming notification and sending back a confirmation message.
Explores premium sms content and subscription models, showing how shortcodes, keywords, and shared vs dedicated setups monetize content, with subscription callbacks and subscribe/unsubscribe flows, and revenue sharing with gateways.
Create a subscription product using a shortcode to send premium sms to users, and attach keywords like news or scores for opt-in via text.
Set up a server script to handle subscription notifications for USSD and SMS apps, using a subscription callback URL with the buckyballs gateway to trigger on subscribe or unsubscribe.
Explore the subscribers table in the database, which stores phone numbers of premium subscribers, a keyword score per user, and an active flag to manage active and inactive subscribers.
Explore premium sms workflows, including subscribing users, requesting tokens, and managing subscriptions in sandbox and live environments, with documentation, callbacks, and the content service for premium messages.
Explore extending the sms class with subscribe by user and subscribe with token, manage premium sms delivery, and track active versus inactive numbers for targeted sms and campaigns.
Add a unique constraint on the subscribers table combining phone number, shortcode, and keyword to enforce a unique triple, allowing phone numbers to subscribe to multiple shortcuts with distinct keywords.
Implement subscribe and unsubscribe logic by preparing and executing statements to insert or update subscribers table, using phone number, shortcode, keyword, and active flag (1 for subscribe, 0 for unsubscribe).
Complete the sendPremiumSms function by building a content payload and sending to active recipients for a given shortcode and keyword via the content service.
Wire the premium sms callback URL script to the sms class logic to process subscribe and unsubscribe requests by phone number, shortcode, and keyword using the database connection.
Test subscribe and unsubscribe flows for premium SMS using a short code and keyword. Validate subscription status through a simulator and database update, ensuring unsubscribed users cannot receive premium content.
Create a simple premium sms sender by building a form that collects shortcode, keyword, and message, posts to a handler. The system processes the delivery with a simulated response.
Subscribe users with a checkout token by using a shortcode and phone number with user consent. Retrieve the token, then create the subscription and handle responses.
Fetch new subscribers from the gateway via the fake subscriptions method, then register each phone number as a user using the subscribe user function with database connection, shortcut, and keyword.
Create a simple web interface to subscribe users to a short code and keyword, and fetch current subscribers, wiring a subscribe user script with a token.
Test fetch user subscription functionality by simulating subscriptions (short code 333, keyword news), process gateway responses, and verify active numbers update the subscribers table for premium service.
Move your ussd and sms app from sandbox to live environment, and verify the business logic by testing features on a real mobile phone.
Explore the stages from sandbox to testbed and production, and learn how to switch endpoints, credentials, and call buckyballs, with required production documents for live access.
Identify the information required to request a USSD service code, including country, target telecoms, shared or dedicated codes, costs, and government-issued entity documents.
Identify the requirements for requesting a premium sms shortcode, including country of operation, target telecoms, and available keywords, whether shared or dedicated, plus pricing and legal business details.
Explore the requirements for requesting a two-way shortcode, enabling bidirectional messaging and mirroring premium shortcode rules, with optional user charges where applicable.
Learn the information required to request a sender ID or branded SMS, including country, telecom company, brand registration, and a clear description of your business.
Explore AT's 80-hour live environment and sandbox context, manage teams and apps, access full service instances, and request premium products.
Test user registration via USSD in a live environment using a shortcode and a mobile phone. Observe the SMS notification and verify registration in the production database.
Test user registration via an SMS shortcode in a live environment by using a shortcut with namespace and password, and verify the user record is created.
Test invalid entry in a live USSD session to verify how the menu handles out-of-scope inputs, provides a retry option, and lets users continue a session to check balance.
Test the ussd flow in a live environment by enabling 98 to go back one step and 99 to return to the main menu, ensuring users remain in the session.
Demonstrate subscribing a user to a premium SMS/USSD service, recording the subscriber in the database via a callback, and offering an unsubscribe option using a predefined shortcode.
Dial the USSD codes to unsubscribe, navigate the menu to confirm unsubscription, then observe the subscriber’s active status update to zero in the live environment rather than deleting the record.
Demonstrates subscribing a user to a premium service from a server, showing the subscription flow, user confirmation on the phone, and how timeouts are handled when the user is unavailable.
Explore monetization strategies for USSD and SMS apps by examining market examples and diverse business models to generate revenue.
Explore how banks use USSD and SMS service codes to let customers check balances, transfer funds, and pay bills through GSM networks and gateways for banking.
Explore how premium sms and ussd workflows enable news content subscriptions, with user consent, premium shortcode-based subscription, and payment deducted from prepaid airtime by the mobile operator.
Learn how to monetize your USSD and SMS skills by billing an employer, consulting for clients, or selling premium content via shortcode, with wholesale and retail messaging options.
In this course, you will have the opportunity to learn how USSD apps are related the GSM network. The course covers how to build menu driven USSD apps and how to integrate it with different types of SMS such as shortcode, branded SMS and premium SMS. USSD menu navigation will cover, go back, go forward, go to main menu and detecting invalid entries.
The course will teach you how design and build apps, which will deliver services to any type of phone - including feature phones. It also teaches you how to choose an SMS and USSD gateway as well as how to monetize you USSD skills (especially for entrepreneurs).
This course is hands on and throughout it, we will build a complete mobile money application based on USSD using PHP, MySQL. In addition, throughout the course we use other tools such as Postman, Composer, Ngrok, apache web server and USSD simulator as well as the HTTP protocol.
In summary, the course is organized into the following sections:
Introduction to USSD and SMS Applications
Introduction to PHP programming language and HTTP protocol
Building and Testing USSD Application Menu
Adding application functionality or logic to the USSD Menus
Adding SMS functionality to the USSD application – two-way, branded, and premium SMS
Moving from SANDBOX environment to LIVE environment
Monetizing USSD and SMS Applications