Advertisement
Guest User

Untitled

a guest
Apr 9th, 2020
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.41 KB | None | 0 0
  1. import requests
  2. url = 'https://api.twilio.com/2010-04-01/Accounts/{0}/Messages.json'.format(settings.OTP_TWILIO_ACCOUNT)
  3. data = {
  4.     'From': settings.OTP_TWILIO_FROM,
  5.     'To': '+38050xxxxxxx',
  6.     'Body': 'Your verification code is 12345',
  7. }
  8. response = requests.post(
  9.     url, data=data,
  10.     auth=(settings.OTP_TWILIO_ACCOUNT, settings.OTP_TWILIO_AUTH)
  11. )
  12. response.raise_for_status()
  13. print(response.json())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement