The SDK needs to be configured with your app username and API key, which you get from the dashboard.
You can use this SDK for either production or sandbox apps. For sandbox, the app username is ALWAYS
sandbox
All methods are asynchronous (i.e. will not block current thread Future based)
All phone numbers use the international format. e.g. +234xxxxxxxx
.
All amount strings contain currency code as well. e.g. UGX 443.88
.
fetchApplicationData()
: Get app information. e.g. balance
send(String phoneNumber, String amount)
: Send airtime to a phone number. Example amount would beKES 150
.
For more information about status notification, please read http://docs.africastalking.com/airtime/callback
-
send(String message, String[] recipients)
: Send a message -
sendPremium(String message, String keyword, String linkId, String[] recipients)
: Send a premium SMS -
fetchMessages()
: Fetch your messages -
fetchSubscription(String shortCode, String keyword)
: Fetch your premium subscription data -
createSubscription(String shortCode, String keyword, String phoneNumber, String checkoutToken)
: Create a premium subscription -
deleteSubscription(String shortCode, String keyword, String phoneNumber)
: Remove a phone number from a premium subscription
For more information on:
- How to receive SMS: http://docs.africastalking.com/sms/callback
- How to get notified of delivery reports: http://docs.africastalking.com/sms/deliveryreports
- How to listen for subscription notifications: http://docs.africastalking.com/subscriptions/callback
-
cardCheckout(String productName, String amount, PaymentCard paymentCard, String narration, Map metadata)
: Initiate card checkout. -
validateCardCheckout(String transactionId, String otp)
: Validate a card checkout -
bankCheckout(String productName, String amount, BankAccount bankAccount, String narration, Map metadata)
: Initiate bank checkout. -
validateBankCheckout(String transactionId, String otp)
: Validate a bank checkout -
bankTransfer(String productName, List<Bank> recipients)
: Move money form payment wallet to bank account -
mobileCheckout(String productName, String phoneNumber, String amount)
: Initiate mobile checkout. -
mobileB2C(String productName, List<Consumer> consumers)
: Send mobile money to consumer. -
mobileB2B(String productName, Business recipient)
: Send mobile money to business. -
walletTransfer(String productName, long targetProductCode, String amount, HashMap<String, String> metadata)
: Move money form one payment product to another. -
topupStash(String productName, String amount, HashMap<String, String> metadata)
: Move money from payment product to app's stash.
For more information, please read http://docs.africastalking.com/payments
-
call(String phoneNumber)
: Initiate a phone call -
fetchQueuedCalls(String phoneNumber)
: Get queued calls -
uploadMediaFile(String phoneNumber, String url)
: Upload voice media file -
ActionBuilder
: Build voice xml when callback URL receives aPOST
from Africa's Talking-
say()
: Add aSay
action. -
play()
: Add aPlay
action. -
getDigits()
: Add aGetDigits
action. -
dial()
: Add aDial
action. -
conference()
: Add aConferemce
action. -
record()
: Add aRecord
action. -
enqueue()
: Add aEnqueue
action. -
dequeue()
: Add aDequeue
action. -
reject()
: Add aReject
action. -
redirect()
: Add aRedirect
action. -
build()
: Finally build the xml
-
For more information, please read http://docs.africastalking.com/voice
-
createCheckoutToken(String phoneNumber)
: Create a new checkout token forphoneNumber
. -
generateAuthToken()
: Generate an auth token to use for authentication instead of an API key.
For more information, please read http://docs.africastalking.com/ussd
If you find a bug, please file an issue on [our issue tracker on GitHub]