Created
August 2, 2016 18:41
-
-
Save ragowthaman/0508a741aabb741a90c54e34a6d4b216 to your computer and use it in GitHub Desktop.
send SMS from Django app Plivo
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 plivo | |
| def send_sms_plivo(to, message): | |
| """ | |
| Send message via plivo service 0.0037 USD/sms; only outgoing | |
| :return: | |
| """ | |
| auth_id = "....." | |
| auth_token="..........." | |
| p = plivo.RestAPI(auth_id, auth_token) | |
| params = {'src': 'countrycodephonenumber', 'method': 'POST', 'dst': 'countrycodephonenumber', 'text': message} | |
| response = p.send_message(params) | |
| return response |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment