Go to All Forums

Powershell equivalent of curl to fetch monitor current status

Hi,

 

I am fetching the json response via 

curl www.site24x7.com/api/current_status/<<monitor_id>> -X GET -H "Accept: application/json; version=2.0" -H "Authorization: Zoho-oauthtoken <<access_token>>"

 

I am not able to make the poweshell equivalent of that.. i

Can someone help ?

Like (2) Reply
Replies (1)

Hello Girish,

You can use a Invoke-RestMethod. Try this:


$url="www.site24x7.com/api/current_status/<<monitor_id>>"

$token="Your Token"
Invoke-RestMethod $url -Headers @{Authorization="Zoho-oauthtoken $token"} |ConvertFrom-Json


Regards

Like (0) Reply

Was this post helpful?