Skip to content

Instantly share code, notes, and snippets.

@dtkloud dtkloud/SendSMS.ps1
Created Apr 3, 2019

Embed
What would you like to do?
$to = "+61412345678"
$validity = "60"
$message = "On average, cats spend 2/3 of every day sleeping. That means a nine-year-old cat has been awake for only three years of its life"
$body = @{"to"=$to;"validity"=$validity;"body"="$message"}
$body = $body | ConvertTo-JSON -depth 99
$uri = "https://tapi.telstra.com/v2/messages/sms"
Invoke-RestMethod -Uri $uri -ContentType "application/json" -Headers @{"Authorization"="Bearer $access_token"} -Method POST -Body $Body
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.