{"info":{"_postman_id":"f0bb4ab1-015f-4fa0-b100-b64174d45798","name":"USSD API DOCUMENTATION","description":"<html><head></head><body><h1 id=\"introduction\">INTRODUCTION</h1>\n<p>When you dial *<em><strong>920#</strong></em> on your mobile phone, you will definitely be using a USSD (Unstructured Supplementary Service Data) application.</p>\n<p>USSD allows the transport of small data volumes over the signaling channel. It does not need an active data connection nor does it incur SMS costs. Processing USSD requests using our API is very fluid once your account is set up.</p>\n<p>Our USSD API allows developers to create their own menu structure with the use of HTTP/S.</p>\n<h3 id=\"why-use-a-ussd\">Why Use a USSD?</h3>\n<ul>\n<li>It is accessible on all cellular networks and mobile handsets</li>\n<li>WAP browsing, prepaid callback service</li>\n<li>Mobile money services</li>\n<li>Location-based content services</li>\n<li>Menu-based information services (Balance Enquiry, etc)</li>\n<li>Serves as a part of configuring the phone on the network.</li>\n</ul>\n<h1 id=\"prerequisite\">PREREQUISITE</h1>\n<h2 id=\"to-successfully-complete-the-integration-the-following-details-are-required-as-described-in-table-10-below\">To successfully complete the integration the following details are required as described in table 1.0 below:</h2>\n<p>Table 1.0</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>REQUIREMENT</th>\n<th>DESCRIPTION</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>USer ID</td>\n<td>This is a unique identification created by Nalo for third parties doing the integration</td>\n</tr>\n<tr>\n<td>Endpoint URL</td>\n<td>This is the URL where all requests from the mobile handset will be terminated. This should be provided by the other part to NALO</td>\n</tr>\n<tr>\n<td>Method</td>\n<td>POST</td>\n</tr>\n<tr>\n<td>Data Format</td>\n<td>JSON</td>\n</tr>\n<tr>\n<td>Content type</td>\n<td>Application/json</td>\n</tr>\n</tbody>\n</table>\n</div></body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[{"content":"INTRODUCTION","slug":"introduction"},{"content":"PREREQUISITE","slug":"prerequisite"}],"owner":"7705958","collectionId":"f0bb4ab1-015f-4fa0-b100-b64174d45798","publishedId":"UyrEhaLQ","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2022-04-28T11:34:06.000Z"},"item":[{"name":"RECEIVING MOBILE REQUESTS","item":[{"name":"RECEIVING MOBILE REQUESTS","id":"11954f60-cd99-4908-946e-57c544d17a0b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"USERID\": \"NALOTest\",\n    \"MSISDN\": \"233XXXXXXXXX\",\n    \"USERDATA\": \"3\",\n    \"MSGTYPE\": false,\n    \"NETWORK\": \"MTN\",\n    \"SESSIONID\":\"16590115252429751\"\n}","options":{"raw":{"language":"json"}}},"url":"{{YOUR_ENDPOINT_URL}}","urlObject":{"host":["{{YOUR_ENDPOINT_URL}}"],"query":[],"variable":[]}},"response":[{"id":"6a70de82-91a7-4287-bb6d-be9ac243c812","name":"RECEIVING MOBILE REQUESTS","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"USERID\": \"NALOTest\",\n    \"MSISDN\": \"233XXXXXXXXX\",\n    \"USERDATA\": \"3\",\n    \"MSGTYPE\": false,\n    \"NETWORK\": \"MTN\"\n}","options":{"raw":{"language":"json"}}},"url":"{{USSDBaseURL}}{{endPoint}}"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Thu, 02 Apr 2020 05:26:15 GMT"},{"key":"Server","value":"Apache"},{"key":"Set-Cookie","value":"PHPSESSID=5501a6240fc5831b3e832fb7c6f56567; path=/"},{"key":"Expires","value":"Thu, 19 Nov 1981 08:52:00 GMT"},{"key":"Cache-Control","value":"no-store, no-cache, must-revalidate"},{"key":"Pragma","value":"no-cache"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"X-XSS-Protection","value":"1; mode=block"},{"key":"Content-Length","value":"186"},{"key":"Keep-Alive","value":"timeout=5, max=100"},{"key":"Connection","value":"Keep-Alive"},{"key":"Content-Type","value":"text/html; charset=UTF-8"}],"cookie":[],"responseTime":null,"body":"{\n    \"USERID\": \"NALOTest\",\n    \"MSISDN\": \"233XXXXXXXXX\",\n    \"USERDATA\": \"3\",\n    \"MSG\": \"Welcome 233XXXXXXXXX.\\nThis is NALOTest USSD\\nHow are you today\\n1. Not fine\\n2. Feeling fisky\\n3. Sad\",\n    \"MSGTYPE\": true\n}"}],"_postman_id":"11954f60-cd99-4908-946e-57c544d17a0b"}],"id":"5a558252-1a28-4f58-bde7-a7accd4ecb8b","description":"<p>The request from the mobile user will be forwarded to the third party via the endpoint URL already given by the client. The data is JSON formatted and contains the following as described in the table 2.0 below:</p>\n<p>Table 2.0</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>ELEMENT</th>\n<th>DESCRIPTION</th>\n<th>FORMAT (LENGTH)</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>USERID</td>\n<td>This is the ID provided by NALO to the client</td>\n<td>STRING (8)</td>\n</tr>\n<tr>\n<td>MSISDN</td>\n<td>The mobile number of the user</td>\n<td>STRING (12)</td>\n</tr>\n<tr>\n<td>USERDATA</td>\n<td>The value entered by the user</td>\n<td>STRING (120 max.)</td>\n</tr>\n<tr>\n<td>MSGTYPE</td>\n<td>This indicates whether the request is a first-time request or not</td>\n<td>BOOLEAN 1/0 1: true 0:false</td>\n</tr>\n<tr>\n<td>SESSIONID</td>\n<td>This is a unique ID for the USSD session.</td>\n<td>STRING</td>\n</tr>\n</tbody>\n</table>\n</div>","event":[{"listen":"prerequest","script":{"id":"465af9d2-b701-47de-88c4-d0fda28101df","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"8620bc51-1f33-4bff-9ecb-82f76d8cd78c","type":"text/javascript","exec":[""]}}],"_postman_id":"5a558252-1a28-4f58-bde7-a7accd4ecb8b"},{"name":"SENDING RESPONSE TO USER","item":[{"name":"SENDING RESPONSE TO USER","id":"028bb3ee-3a8f-4ad5-8ddf-aeb3be02ade8","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"USERID\": \"NALOTest\",\n    \"MSISDN\": \"233XXXXXXXXX\",\n    \"USERDATA\": \"4\",\n    \"MSGTYPE\": false,\n    \"NETWORK\": \"MTN\"\n}","options":{"raw":{"language":"json"}}},"url":"{{YOUR_ENDPOINT_URL}}","urlObject":{"host":["{{YOUR_ENDPOINT_URL}}"],"query":[],"variable":[]}},"response":[{"id":"8cbf2381-e4ae-4ad8-bc84-c6b036c804d6","name":"RECEIVING MOBILE REQUESTS","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"USERID\": \"NALOTest\",\n    \"MSISDN\": \"233543425046\",\n    \"USERDATA\": \"3\",\n    \"MSGTYPE\": false,\n    \"NETWORK\": \"MTN\"\n}","options":{"raw":{"language":"json"}}},"url":"{{USSDBaseURL}}{{endPoint}}"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Thu, 02 Apr 2020 04:57:28 GMT"},{"key":"Server","value":"Apache"},{"key":"Set-Cookie","value":"PHPSESSID=7c2729e1d1bc03d75741e4e3a159be0c; path=/"},{"key":"Expires","value":"Thu, 19 Nov 1981 08:52:00 GMT"},{"key":"Cache-Control","value":"no-store, no-cache, must-revalidate"},{"key":"Pragma","value":"no-cache"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"X-XSS-Protection","value":"1; mode=block"},{"key":"Content-Length","value":"186"},{"key":"Keep-Alive","value":"timeout=5, max=99"},{"key":"Connection","value":"Keep-Alive"},{"key":"Content-Type","value":"text/html; charset=UTF-8"}],"cookie":[],"responseTime":null,"body":"{\n    \"USERID\": \"NALOTest\",\n    \"MSISDN\": \"233543425046\",\n    \"USERDATA\": \"3\",\n    \"MSG\": \"Welcome 233543425046.\\nThis is NALOTest USSD\\nHow are you today\\n1. Not fine\\n2. Feeling fisky\\n3. Sad\",\n    \"MSGTYPE\": true\n}"},{"id":"0f2870e2-6809-45c8-a63b-74ac0e8e5b67","name":"SENDING RESPONSE TO USER","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"USERID\": \"NALOTest\",\n    \"MSISDN\": \"233XXXXXXXXX\",\n    \"USERDATA\": \"4\",\n    \"MSGTYPE\": false,\n    \"NETWORK\": \"MTN\"\n}","options":{"raw":{"language":"json"}}},"url":"{{localhost}}/{{URL}}"},"status":"OK","code":200,"_postman_previewlanguage":"html","header":[{"key":"Date","value":"Thu, 02 Apr 2020 23:06:09 GMT"},{"key":"Server","value":"Apache"},{"key":"Set-Cookie","value":"PHPSESSID=5501a6240fc5831b3e832fb7c6f56567; path=/"},{"key":"Expires","value":"Thu, 19 Nov 1981 08:52:00 GMT"},{"key":"Cache-Control","value":"no-store, no-cache, must-revalidate"},{"key":"Pragma","value":"no-cache"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"X-XSS-Protection","value":"1; mode=block"},{"key":"Content-Length","value":"120"},{"key":"Keep-Alive","value":"timeout=5, max=100"},{"key":"Connection","value":"Keep-Alive"},{"key":"Content-Type","value":"text/html; charset=UTF-8"}],"cookie":[],"responseTime":null,"body":"{\"USERID\":\"NALOTest\",\"MSISDN\":\"233XXXXXXXXX\",\"USERDATA\":\"4\",\"MSG\":\"Invalid option\\nExiting session ...\",\"MSGTYPE\":false}"}],"_postman_id":"028bb3ee-3a8f-4ad5-8ddf-aeb3be02ade8"}],"id":"fb582f73-78b2-4c27-9ca6-03d8b82bdb3c","description":"<p>This is the response to the user’s request. The content provider should provide a response to the request in the same format. The response body should have the following elements as described in table 2.1 below:</p>\n<p>Table 2.0</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>ELEMENT</th>\n<th>DESCRIPTION</th>\n<th>FORMAT (LENGTH)</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>USERID</td>\n<td>This is the ID provided by NALO to the client</td>\n<td>STRING (8) - mandatory</td>\n</tr>\n<tr>\n<td>MSISDN</td>\n<td>The mobile number of the user</td>\n<td>STRING (12) - optional</td>\n</tr>\n<tr>\n<td>MSG</td>\n<td>This is a mandatory parameter that holds the message to be displayed on the user’s phone</td>\n<td>STRING (120 max.)</td>\n</tr>\n<tr>\n<td>MSGTYPE</td>\n<td>This indicates whether the session should continue or be terminated</td>\n<td></td>\n</tr>\n<tr>\n<td>BOOLEAN: true/false – defaults to ‘True’</td>\n<td></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n</div>","event":[{"listen":"prerequest","script":{"id":"da20c075-d651-47fd-92dc-1b22903dc7c6","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"65930a96-3fdb-4d11-bfc3-a0e3ada01c4a","type":"text/javascript","exec":[""]}}],"_postman_id":"fb582f73-78b2-4c27-9ca6-03d8b82bdb3c"},{"name":"USSD FAQs","item":[],"id":"877e1bec-5f8a-4052-a7c8-6cdbab148a0f","description":"<h2 id=\"what-is-a-ussd\">What is a ussd?</h2>\n<p>USSD(Unstructured Supplementary Service Data) is an interactive technology that serves to send text between a mobile phone and an application programme in a network. Some of these services are</p>\n<ul>\n<li>Airtime top-ups</li>\n<li>Balance checking</li>\n<li>Mini statements delivery</li>\n</ul>\n<h2 id=\"the-format-is-confined-by--and--at-the-beginning-and-end-of-the-series-of-digits\">The format is confined by * and # at the beginning and end of the series of digits.</h2>\n<h2 id=\"how-do-i-get-a-ussd-shortcode\">How do I get a USSD shortcode?</h2>\n<p>Kindly sign up if you have no account and make a request here.\n<a href=\"https://sms.nalosolutions.com/nalosms/login.php\">NALO SOLUTIONS</a></p>\n<h2 id=\"how-much-does-a-ussd-shortcode-cost\">How much does a USSD shortcode cost?</h2>\n<p>Refer to this page to view our pricing list.\n<a href=\"https://www.nalosolutions.com/\">NALO SLOUTIONS USSD PRICE LIST</a></p>\n<h2 id=\"how-do-i-pay-for-the-ussd-code\">How do I pay for the USSD code?</h2>\n<p>You can make payment via mobile money or bank transfer</p>\n<h2 id=\"are-there-different-types-of-ussd-code\">Are there different types of USSD code?</h2>\n<p>Yes. We have a dedicated and and shared USSD code.</p>\n<p>A dedicated code is a code that is owned by one client only. For example, Bank A has a dedicated short code *999#. This means no other client can operate under this code because it is dedicated specifically to bank A.\nA shared USSD code is rented out to multiple clients. For example, Bank A may use *999*12# and Bank B will have access to *999*13#\nA dedicated code is more expensive than a shared code.</p>\n","event":[{"listen":"prerequest","script":{"id":"d8ddb6ea-c0c4-4c36-9572-c669b2cd69a2","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"3c17dae9-66ee-43da-9335-75927836fa47","type":"text/javascript","exec":[""]}}],"_postman_id":"877e1bec-5f8a-4052-a7c8-6cdbab148a0f"},{"name":"SAMPLE USSD CODE","item":[{"name":"SAMPLE CODE OUTPUT - INITIAL SCREEN","id":"d200d4e1-8a13-4092-857e-441142ffac23","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"USERID\": \"NALOTest\",\n    \"MSISDN\": \"233XXXXXXXXX\",\n    \"USERDATA\": \"9\",\n    \"MSGTYPE\": true\n}","options":{"raw":{"language":"json"}}},"url":"{{clientUSSDEndPoint}}","urlObject":{"host":["{{clientUSSDEndPoint}}"],"query":[],"variable":[]}},"response":[{"id":"9d155e39-3484-4c60-91c6-2a3f30fbf6bf","name":"SAMPLE CODE OUTPUT - INITIAL SCREEN","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"USERID\": \"NALOTest\",\n    \"MSISDN\": \"233XXXXXXXXX\",\n    \"USERDATA\": \"9\",\n    \"MSGTYPE\": true\n}","options":{"raw":{"language":"json"}}},"url":"{{USSDBaseURL}}/{{endPoint}}"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Sat, 04 Apr 2020 23:46:36 GMT"},{"key":"Server","value":"Apache"},{"key":"Set-Cookie","value":"PHPSESSID=5501a6240fc5831b3e832fb7c6f56567; path=/"},{"key":"Expires","value":"Thu, 19 Nov 1981 08:52:00 GMT"},{"key":"Cache-Control","value":"no-store, no-cache, must-revalidate"},{"key":"Pragma","value":"no-cache"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"X-XSS-Protection","value":"1; mode=block"},{"key":"Content-Length","value":"196"},{"key":"Keep-Alive","value":"timeout=5, max=98"},{"key":"Connection","value":"Keep-Alive"},{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n    \"USERID\": \"NALOTest\",\n    \"MSISDN\": \"233XXXXXXXXX\",\n    \"USERDATA\": \"9\",\n    \"MSG\": \"Welcome to NALO test demo\\nThis is to help you get started with session/data management\\nEnter your name please\",\n    \"MSGTYPE\": true\n}"}],"_postman_id":"d200d4e1-8a13-4092-857e-441142ffac23"},{"name":"SAMPLE CODE OUTPUT - SECOND SCREEN","id":"f4727d2e-61ec-4e46-9e22-0580cacae493","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"USERID\": \"NALOTest\",\n    \"MSISDN\": \"233XXXXXXXXX\",\n    \"USERDATA\": \"NALO SOLUTIONS LTD\",\n    \"MSGTYPE\": false\n}","options":{"raw":{"language":"json"}}},"url":"{{clientUSSDEndPoint}}","urlObject":{"host":["{{clientUSSDEndPoint}}"],"query":[],"variable":[]}},"response":[{"id":"35a585b1-1566-4779-a8c7-1381c6530ae6","name":"SAMPLE CODE OUTPUT  - SECOND SCREEN","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"USERID\": \"NALOTest\",\n    \"MSISDN\": \"233XXXXXXXXX\",\n    \"USERDATA\": \"NALO SOLUTIONS LTD\",\n    \"MSGTYPE\": false\n}","options":{"raw":{"language":"json"}}},"url":"{{USSDBaseURL}}/{{endPoint}}"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Sat, 04 Apr 2020 23:44:17 GMT"},{"key":"Server","value":"Apache"},{"key":"Set-Cookie","value":"PHPSESSID=5501a6240fc5831b3e832fb7c6f56567; path=/"},{"key":"Expires","value":"Thu, 19 Nov 1981 08:52:00 GMT"},{"key":"Cache-Control","value":"no-store, no-cache, must-revalidate"},{"key":"Pragma","value":"no-cache"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"X-XSS-Protection","value":"1; mode=block"},{"key":"Content-Length","value":"233"},{"key":"Keep-Alive","value":"timeout=5, max=100"},{"key":"Connection","value":"Keep-Alive"},{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n    \"USERID\": \"NALOTest\",\n    \"MSISDN\": \"233XXXXXXXXX\",\n    \"USERDATA\": \"NALO SOLUTIONS LTD\",\n    \"MSG\": \"Hello NALO SOLUTIONS LTD, \\nYour initial dial was 9\\nInputs were successfully stored and passed on to this screen.\\nHappy Coding :)\",\n    \"MSGTYPE\": false\n}"}],"_postman_id":"f4727d2e-61ec-4e46-9e22-0580cacae493"}],"id":"e15198b7-3fde-4899-9ac5-8ddbfef373e9","description":"<h1 id></h1>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>&lt;?php  \n/**  \n* This is a sample USSD code with session management.   \n* It has only two screens.The purpose is to help developers get started with their USSD application and session management.  \n*/\n\n&lt;!--read incoming data  --&gt;\n\n$request = file_get_contents(\"php://input\");\n\n&lt;!--convert the json object ($request) to a PHP object.  --&gt;\n\n$data = json_decode($request, true);\n\n/**  \n* set your custom session id and start session for the incoming request.  \n* Note!! \n* The only unique parameter is the msisdn.   \n* Set session id with the msisdn in order to track the session  \n*/  \n\nsession_id(md5($data['MSISDN']));\nsession_start();\n\n&lt;!--Get All Incoming Request Parameters  --&gt;\n\n$ussd_id = $data['USERID'];\n$msisdn = $data['MSISDN'];\n$user_data = $data['USERDATA'];\n$msgtype = $data['MSGTYPE'];\n$id = session_id();\n     \n&lt;!--Subsequent dials--&gt;\n\nif (isset($_SESSION[$id]) and $msgtype==false) {  \n   $_SESSION[$id] = $_SESSION[$id].$user_data;  \n   $user_dials = preg_split(\"/\\#\\*\\#/\",  \n   $_SESSION[$id]);\n   $msg = \"Hello \".$user_dials[1].\", Your initial dial was \".$user_dials[0].\"\\nInputs were successfully stored and passed on to this screen.\\nHappy Coding :)\";  \n   $resp = array(\"USERID\"=&gt;$ussd_id, \"MSISDN\"=&gt;$msisdn, \"USERDATA\"=&gt;$user_data, \"MSG\"=&gt;$msg, \"MSGTYPE\"=&gt;false);  \n   echo json_encode($resp);\n   session_destroy();  \n }\n\n// Initial dial\n\nelse { \n   \n   &lt;!-- To reinitial session variable in case the use cancelled initial screen --&gt;\n    if(isset($_SESSION[$id]) and $msgtype==true){\n        session_unset();\n    }\n\n    /**\n    * Stores user inputs using sessions. \n    * You may also store user inputs in a database\n    */  \n\n    $_SESSION[$id] = $user_data.\"#*#\";\n\n// Responds to request. MSG variable will be displayed on the user's screen  \n\n    $msg = \"Welcome to NALO test demo\\nThis is to help you get started with session/data management\\nEnter your name please\";\n    $resp = array(\"USERID\"=&gt;$ussd_id, \"MSISDN\"=&gt;$msisdn, \"USERDATA\"=&gt;$user_data, \"MSG\"=&gt;$msg, \"MSGTYPE\"=&gt;true);\n    echo json_encode($resp);  \n }\n\nheader('Content-type: application/json'); \n\n?&gt;\n</code></pre>","event":[{"listen":"prerequest","script":{"id":"49f0751f-93b0-400c-8446-ecc3f02db5af","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"4035277b-34f9-4592-8282-d9faee69673e","type":"text/javascript","exec":[""]}}],"_postman_id":"e15198b7-3fde-4899-9ac5-8ddbfef373e9"}],"event":[{"listen":"prerequest","script":{"id":"f5797295-fe0c-4df8-a8c0-3dc1d3584f58","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"f7392d1c-2fa6-4b85-b638-dceed0901b06","type":"text/javascript","exec":[""]}}]}