Skip to content

Instantly share code, notes, and snippets.

@dtkloud
Created April 3, 2019 00:34
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save dtkloud/b5b6df2f4f632ef205e738389dbb75ba to your computer and use it in GitHub Desktop.
$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