-
-
Save VictorOmondiCDS/3940f58c9be143940ea985e7ff3aab7a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import africastalking | |
username = "africa username" # use 'sandbox' for development in the test environment | |
# use your sandbox app API key for development in the test environment | |
api_key = "africa's talking api key" | |
africastalking.initialize(username, api_key) | |
# # Use the service synchronously | |
# response = sms.send("Hello Message!", ["+2547xxxxxx"]) | |
# print(response) | |
# Or use it asynchronously | |
def on_finish(error, response): | |
if error is not None: | |
raise error | |
# write to the logs | |
print(response) | |
numbers = [] | |
def send_sms(message, numbers): | |
sms = africastalking.SMS | |
sms.send(message, numbers, callback=on_finish) | |
message = "Your message hoes here" | |
send_sms(message, numbers) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment