Monday, January 16, 2017

Using PowerShell to call API

Below is a sample PowerShell script that call an sms API.

# powershell -ExecutionPolicy Bypass -File "FIlename"
$yourUri = "http://gateway.yesmsfusion.no/V1/smsapi.asmx/SendSms"
Invoke-WebRequest -Uri $yourUri -Method Post -Body @{
apiKey="LJLKJL233RNL3ACLSZB3M6ZOU19K"
receipient="+639171234567"
message="Het buddy! call me when your FREE. - PowerShell"
replyPath=""
originator="Biboy"
}

No comments:

Post a Comment