...
401 Unauthorized
429 Too Many Requests
Example script to extract a list of all reporting devices and their misconfigurations
Code Block |
---|
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("x-api-key", "{API KEY}")
$headers.Add("Content-Type", "application/json")
$body = "{}"
$response = Invoke-RestMethod 'https://{BASEURL}/gytpolapi/v2.0/get_misconfigurations_start ' -Method 'POST' -Headers $headers -Body $body
do {
$response | ConvertTo-Json -Depth 3
$body = @{ token = $response.token } | ConvertTo-Json
$response = Invoke-RestMethod 'https://{BASEURL}/gytpolapi/v2.0/get_misconfigurations_next ' -Method 'POST' -Headers $headers -Body $body
} until ($response.computers.Count -eq 0) |
get_miscon_computers_start
...