Hi All.
I am trying to write a script that will call an API from powershell 100 times, the equivalent curl script is as follows.
curl --location --request GET 'https://my-api-url/224/employee' \
--header 'URN-Token: xxxxxxxxxxxxx' \
--header 'URN: 224'
I put together the script below, but I am getting a 400 error.
$urn = 224
#$token = 'xxxxxxxxxxxxx'
$url = "https://my-api-url/$urn/employee"
$headers = @{
'urn-ID' = '224'
'ID-token' = 'xxxxxxxxxxxxx'
}
Invoke-RestMethod -Uri $url -Headers $headers