Prerequisites

Introduction

Africa's Talking APIs are accessible on the web via HTTP(s). To access the endpoints therefore, you should be running an environment that can interact with the World Wide Web, most notably using a web server.

Before you interact with the code samples over at http://docs.africastalking.com/ or in this booklet, kindly ensure that you have prepared your environment as below.

  • Web server: You should set up a web server that exposes your application to the internet. The most common web server is Apache, but you can use any web server that you are familiar with. Note that some frameworks come bundled with a web server by default.

  • Publicly exposed URL: Given that most developers use their localhost for the development process, it is important to note that this does not expose the developed application to the internet -- even though the application can send HTTP requests to various endpoints. To be accessible to other hosts online e.g the Africa's Talking Servers, the application should be accessible by external hosts via a public IP/URL. You can use ngrok to tunnel your local host to the internet (it is free to use) or set up a Vagrant instance that allows you a free Publicly available URL via the Vagrant Share command.

    • A bit on Callbacks

      (Also called a webhook.)

      This is an address that a server provides, and any computer in the internet/private network can POST data to it. This proves to be more efficient as opposed to a computer continuously waiting or polling for data.

      Take an example of a post office. The PO gives you an address box where the whole world can send you letters and you do not have to be there to receive. You can just periodically check for your mail. For this to work, you have to share your address with anyone interested in sending you mail. Whatever you receive has to also be appropriately packaged in the rules that the PO gives (size, weight, stamp etc)

      This is similar to how a call back work. You have to set up the call back in the way that the sender of the data you want specifies. E.g. a call back for Facebook to receive data from FB is different to how you will set up a call back to receive data from AT.

  • Test Environment: All the Africa's Talking endpoints can be tested in a sandbox environment. Africa's Talking has also partnered with various local mobile service providers (e.g. Safaricom in Kenya and Etisalat in Nigeria) to provide live test accounts for developers. You can test your application either on the sandbox or on a live environment. However, it is advisable that your workflow starts with the sandbox and then moves to live test bed for demo purposes.

    • SandBox: On the sandbox, you should follow the steps below to start developing your app.
      1. Sign Up or Log In to the Sandbox at: https://sandbox.africastalking.com/login
      2. Create an API key that you will use together with your username for authentication
      3. Create the resource you want to build an application on: Short Code, USSD, Payment Product/Channel or Voice number.
      4. Head over to the documentations page and get the sample code for the service you want to run. To interact with your resources in the sandbox, update the APIKey, Username and resource(where needed) to reflect your sandbox values.
      5. With your code ready, you can now interact with your application. You should use the simulator: https://simulator.africastalking.com:1517 to do this. Make sure you register the same number on the simulator as you use in your code.
      6. To quickly run through what the simulator and the sandbox are all about we have created a quick video that you can have a look at here.
    • Live Test Bed: As mentioned earlier, courtesy of Africa's Talking Partners, you can use a live USSD or Short Code to test your application with a focus group or a team or testers. You can follow the steps below to start live testing in the markets that these resources are available.
      1. Sign Up or Log In to the Live Account at: https://account.africastalking.com/login
      2. ONLY IF YOU DON'T have one, create an API Key that you should use together with your username for authentication. This is DIFFERENT from your Sandbox credentials.
      3. To get the Short Code or USSD resource, kindly send an email to _[email protected] _In your email, include a list of numbers that you want to join your tester group for white-listing.
      4. It is advisable to request for a live testing environment after using the sandbox. Therefore you should already have a working application.

results matching ""

    No results matching ""