08 Sep 2021
12:13 AM
- last edited on
18 Nov 2021
01:36 AM
by
MaciejNeumann
Hi All
I'm following the Extensions 2 documentation to get schemas provided through the Extension 2.0.
I'm using Powershell's invoke-restmethod. This is my current code:
Having tried a few iterations, I consistently get:
Invoke-RestMethod : {"error":{"code":401,"message":"Missing authorization parameter."}}
I'm using a token generated from dynatrace.
Any help on where I'm going wrong would be appreciated.
Cheers
Solved! Go to Solution.
Were you able to get this sorted out? If the Token has the correct permissions - which im assuming it does since the error does not reference a lack of permissions, rather the authorization parameter. It looks like you code might not be correct. Try this:
A working example of the above (works in Powershell) :
$Token = 'xxxxxxx'
$Params = @{ "URI" = 'https://[ENV].live.dynatrace.com/api/config/v1/extensions/'
"Method" = 'GET'
"Headers" = @{
"Content-Type" = 'application/json; charset=utf-8'
"Authorization" = 'Api-Token' + ' ' + $Token
}
}
Invoke-RestMethod @Params
Featured Posts