You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Catch BulkSmsZw status errors as python exceptions
You can wrap your code in a try - except to catch unsuccessful and bulksms error messages as normal python exceptions
# this wil throw an exception because of the wrong / not valid usernamebulksms=Client(username=<wrong-username>, token=<web-token>)
try:
response=bulksms.send(body="bulk sms ZW api testing", recipients=['2637xxxxxxxx', '2637yyyyyyyy'])
print(response)
exceptExceptionasexc:
print("Encountered an Error: %s"%exc)
Responses
responses are in default JSON format used by BulkSMSZW service