Downloads
Download Africa's Talking Gateways
You can download helper classes that we have authored at Africa's Talking to help you get up and running quickly from within your code to talk to our endpoints.
In addition, if you prefer, you can actually interact directly with the Africa's Talking gateways using cURL and the endpoints:
Sandbox End Points
1. SMS
Make a HTTP POST request to https://api.sandbox.africastalking.com/version1/messaging
- See the Parameters
curl -v -H "Accept: application/xml" \
-d "username=username&message=hellotest&to=+254700112233" \
-H "Apikey:7587025bf6f044e6b4aa85bfb412f3902f8025465870c9b920a75cc40627892" \
-X POST http://api.sandbox.africastalking.com/version1/messaging --insecure
2. USER DATA
Make a HTTP GET request to https://api.sandbox.africastalking.com/version1/user
- See the Parameters
curl -v -H "Accept: application/xml" \
-H "Apikey:21587025bf6f044e6b4aa85bfb412f3902f8025465870c9b920a75cc40627892" \
https://api.sandbox.africastalking.com/version1/user?username=username --insecure
3. PREMIUM SUBSCRIPTIONS
Make a HTTP POST request to https://api.sandbox.africastalking.com/version1/subscription/create
- See the Parameters
curl -v -H "Accept: application/xml" \
-H "Apikey:fb752d3417021812f0961y6c9464832dd1adb1e555c73f1e7c32bcc006488674" \
-d "username=sandBoxUsername&shortCode=12345&keyword=myPremiumKeyword&phoneNumber=+254711XXXYYY" \
-X POST https://api.sandbox.africastalking.com/version1/subscription/create --insecure
4. AIRTIME
Make a HTTP POST request to https://api.sandbox.africastalking.com/version1/airtime/send
- See the Parameters
curl -v -H "Accept: application/xml" \
-H "Apikey:fb752d3417021812f0961y6c9464832dd1adb1e555c73f1e7c32bcc006488674" \
-d "username=myusername&recipients=[{'phoneNumber':'+254711XXXYYY','amount':'KES X'},{'phoneNumber':'+254733YYYZZZ','amount':'KES Y'}]" \
-X POST http://api.sandbox.africastalking.com/version1/airtime/send --insecure
5. PAYMENTS
Make a HTTP POST request to https://payments.sandbox.africastalking.com/mobile/checkout/request
- See the Parameters
curl -v -X POST -H "Content-Type: application/json" -H "apiKey: 90kol7b633ec100089f24573483af0f6d52dd1471090dae7724258ffe723bb10" -d '{
"username":"api-username",
"productName":"Product name",
"phoneNumber": "+254722000000",
"currencyCode":"KES",
"amount":10
}' "https://payments.sandbox.africastalking.com/mobile/checkout/request"
Make a HTTP POST request to https://payments.sandbox.africastalking.com/mobile/b2c/request
- See the Parameters
curl -v -X POST -H "Content-Type: application/json" -H "apiKey:fb752d3417021812f0961y6c9464832dd1adb1e555c73f1e7c32bcc006488674" -d '{
"username":"your-username",
"productName":"your-product-name",
"recipients":[{"phoneNumber":"+254722000000","currencyCode":"KES","amount":10.50,"metadata":{"name": "Hello","reason" : "World"}}]
}' "https://payments.sandbox.africastalking.com/mobile/b2c/request"
Make a HTTP POST request to https://payments.sandbox.africastalking.com/mobile/b2b/request
- See the Parameters
curl -v -H "Accept: application/xml" \
-H "Apikey:fb752d3417021812f0961y6c9464832dd1adb1e555c73f1e7c32bcc006488674" \
-d "username=myusername&productName=myPaymentProductName" \
-d "provider=Athena&destinationChannel=535400" \
-d "transferType=BusinessToBusinessTransfer" \
-d "providerData=[{'provider':'Mpesa','destinationChannel':'535400','transferType':'BusinessToBusinessTransfer'}]¤cyCode=KES&amount=100&metadata=[{'shopId':'1234','itemId':'abcde'}]" \
-X POST https://payments.sandbox.africastalking.com/mobile/b2b/request --insecure
6. VOICE
Make a HTTP POST request to https://voice.sandbox.africastalking.com/call
- See Parameters
curl -v -H "Accept: application/xml" \
-H "Apikey:fb752d3417021812f0961y6c9464832dd1adb1e555c73f1e7c32bcc006488674" \
-d "username=myUsername&to=+254711XXXYYY&from=+254711082XXX" \
-X POST https://voice.sandbox.africastalking.com/call --insecure
Live End Points
1. SMS
Make a HTTP POST request to https://api.africastalking.com/version1/messaging
- See the Parameters
curl -v -H "Accept: application/xml" \
-d "username=sandBoxUserName&message=hello test&to=+254711XXXYYY,+254733YYYZZZ" \
-H "Apikey:fb752d3417021812f0961y6c9464832dd1adb1e555c73f1e7c32bcc006488674" \
-X POST http://api.africastalking.com/version1/messaging --insecure
2. USER DATA
Make a HTTP GET request to https://api.africastalking.com/version1/user
- See the Parameters
curl -H "Accept: application/xml" \
-H "Apikey:fb752d3417021812f0961y6c9464832dd1adb1e555c73f1e7c32bcc006488674" \
"https://api.africastalking.com/version1/user?username=sandBoxUserName" --insecure
3. PREMIUM SUBSCRIPTIONS
Make a HTTP POST request to https://api.africastalking.com/version1/subscription/create
- See the Parameters
curl -v -H "Accept: application/xml" \
-H "Apikey:fb752d3417021812f0961y6c9464832dd1adb1e555c73f1e7c32bcc006488674" \
-d "username=sandBoxUsername&shortCode=12345&keyword=myPremiumKeyword&phoneNumber=+254711XXXYYY" \
-X POST https://api.africastalking.com/version1/subscription/create --insecure
4. AIRTIME
Make a HTTP POST request to https://api.africastalking.com/version1/airtime/send
- See the Parameters
curl -v -H "Accept: application/xml" \
-H "Apikey:fb752d3417021812f0961y6c9464832dd1adb1e555c73f1e7c32bcc006488674" \
-d "username=myusername&recipients=[{'phoneNumber':'+254711XXXYYY','amount':'KES X'},{'phoneNumber':'+254733YYYZZZ','amount':'KES Y'}]" \
-X POST http://api.africastalking.com/version1/airtime/send --insecure
5. PAYMENTS
Make a HTTP POST request to https://payments.africastalking.com/mobile/checkout/request
- See the Parameters
curl -X POST -H "Content-Type: application/json" -H "apiKey: 90kol7b633ec100089f24573483af0f6d52dd1471090dae7724258ffe723bb10" -d '{
"username":"api-username",
"productName":"Product name",
"phoneNumber": "+254722000000",
"currencyCode":"KES",
"amount":10
}' "https://payments.africastalking.com/mobile/checkout/request"
Make a HTTP POST request to https://payments.africastalking.com/mobile/b2c/request
- See the Parameters
curl -v -X POST -H "Content-Type: application/json" -H "apiKey:fb752d3417021812f0961y6c9464832dd1adb1e555c73f1e7c32bcc006488674" -d '{
"username":"your-username",
"productName":"your-product-name",
"recipients":[{"phoneNumber":"+254722000000","currencyCode":"KES","amount":10.50,"metadata":{"name": "Hello","reason" : "World"}}]
}' "https://payments.africastalking.com/mobile/b2c/request"
Make a HTTP POST request to https://payments.africastalking.com/mobile/b2b/request
- See the Parameters
curl -v -H "Accept: application/xml" \
-H "Apikey:fb752d3417021812f0961y6c9464832dd1adb1e555c73f1e7c32bcc006488674" \
-d "username=myusername&productName=myPaymentProductName" \
-d "provider=Mpesa&destinationChannel=partnerBusinessChannel" \
-d "transferType=BusinessToBusinessTransfer" \
-d "providerData=[{'provider':'Mpesa','destinationChannel':'partnerBusinessChannel','transferType':'BusinessToBusinessTransfer'}]¤cyCode=KES&amount=100&metadata=[{'shopId':'1234','itemId':'abcde'}]" \
-X POST https://payments.africastalking.com/mobile/b2b/request --insecure
6. VOICE
Make a HTTP POST request to https://voice.africastalking.com/call
- See Parameters
curl -v -H "Accept: application/xml" \
-H "Apikey:fb752d3417021812f0961y6c9464832dd1adb1e555c73f1e7c32bcc006488674" \
-d "username=myUsername&to=+254711XXXYYY&from=+254711082XXX" \
-X POST https://voice.africastalking.com/call --insecure