08 Sep 2021 08:13 AM - last edited on 18 Nov 2021 09: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.
22 Sep 2021 06:43 PM - edited 22 Sep 2021 06:44 PM
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:
09 Nov 2022 12:51 PM - edited 09 Nov 2022 12:56 PM
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