Last active
July 6, 2020 07:09
-
-
Save kelvinndmo/e23baf8c3555035b46cacd95be050082 to your computer and use it in GitHub Desktop.
This file contains 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 goes here" | |
send_sms(message, numbers) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Should be making use of it soon, thanks.
Also, on the message area, you might need to correct the part of placeholder from ''hoes' to 'goes'.