WA


$number = "00393357125781"
$message = "Howdy, this is a message from PowerShell."

$clientId = "FREE_TRIAL_ACCOUNT" # No need to change
$clientSecret = "PUBLIC_SECRET" # No need to change

$jsonObj = @{'number'=$number;
'message'=$message;}

Try {
$res = Invoke-WebRequest -Uri 'http://api.whatsmate.net/v1/whatsapp/queue/message' `
-Method Post `
-Headers @{"X-WM-CLIENT-ID"=$clientId; "X-WM-CLIENT-SECRET"=$clientSecret;} `
-Body (ConvertTo-Json $jsonObj)

Write-host "Status Code: " $res.StatusCode
Write-host $res.Content
}
Catch {
$result = $_.Exception.Response.GetResponseStream()
$reader = New-Object System.IO.StreamReader($result)
$reader.BaseStream.Position = 0
$reader.DiscardBufferedData()
$responseBody = $reader.ReadToEnd();

Write-host "Status Code: " $_.Exception.Response.StatusCode
Write-host $responseBody
}

view rawsend-whatsapp.ps1 hosted with ❤ by GitHub
Specify your target recipient on line 1. Remember to include the country code.
Specify your message on line 2.
Run the script in PowerShell to send your message: .\send-whatsapp.ps1
The trial account allows you to send up to 40 messages per day. Upgrade to the Premium Account to send unlimited number of messages.

← PREVIOUS POST NEXT POST →
WhatsMate.net • 2016
Theme by beautiful-jekyll