$Body = @ {
grant_type = 'client_credentials'
client_id = 'Mention the ID'
client_secret = 'Mention the Secret'
}
$head = @ {
'Accept' = '*/*'
'Content-Type' = 'application/x-www-form-urlencoded'
}
$tokenResp = Invoke - WebRequest - Uri 'https://io.catchpoint.com/ui/api/token' - Body $Body - Method 'POST' - headers $head
$tokenJsonObj = ConvertFrom - Json - inputObject $tokenResp
$token = $tokenJsonObj.access_token
$tokenBytes = [System.Text.Encoding]::UTF8.GetBytes($token)
$base64Token = [System.Convert]::ToBase64String($tokenBytes)
Write - Host "aa" $base64Token
$alertData = @ {
'paused_alerts' = @ {
'id' = '0'
}
}
$head1 = @ {
'Accept' = '*/*'
'Content-Type' = 'application/json'
'Authorization' = 'Bearer ' + $base64Token
}
Invoke - WebRequest - Uri 'https://io.catchpoint.com/ui/api/v1/tests/TestID/pauseAlerts' - Body($alertData | ConvertTo - Json) - Method 'POST' - headers $head1
Write - Host "bb" $alertData $Body = @ {
grant_type = 'client_credentials'
client_id = 'Mention the ID'
client_secret = 'Mention the Secret'
}
$head = @ {
'Accept' = '*/*'
'Content-Type' = 'application/x-www-form-urlencoded'
}
$tokenResp = Invoke - WebRequest - Uri 'https://io.catchpoint.com/ui/api/token' - Body $Body - Method 'POST' - headers $head
$tokenJsonObj = ConvertFrom - Json - inputObject $tokenResp
$token = $tokenJsonObj.access_token
$tokenBytes = [System.Text.Encoding]::UTF8.GetBytes($token)
$base64Token = [System.Convert]::ToBase64String($tokenBytes)
Write - Host "aa" $base64Token
$alertData = @ {
'paused_alerts' = @ {
'id' = '0'
}
}
Alertwebhook.xsd
- 1 minute(s) read
Was this article helpful?