Skip to content

Instantly share code, notes, and snippets.

@developersteve
Created November 8, 2017 04:18
Show Gist options
  • Save developersteve/9ff571d0dd568d5ef729978ea2096a50 to your computer and use it in GitHub Desktop.
Save developersteve/9ff571d0dd568d5ef729978ea2096a50 to your computer and use it in GitHub Desktop.
TelstraDev MessagingAPI - Basic python call create sms
import requests
from var_dump import var_dump
url = "https://tapi.telstra.com/v2/messages/sms"
payload = {'to': '000000000000',
'body': 'Hello World',
'from': '000000000000',
'validity': 1,
'scheduledDelivery': 60,
'notifyURL': '',
'replyRequest': 'false'}
headers = {
'accept': 'application/json',
'authorization': 'Bearer abcdefghijklmnop',
'content-type': 'application/json',
}
response = requests.post(url, json=payload, headers=headers)
var_dump(response.content)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment