22 Oct 2020 02:54 PM - last edited on 14 Aug 2023 09:51 AM by MaciejNeumann
I am trying to extract some data from my Dynatrace instance. I am not really experienced using Postman but I am trying to learn as best as I can. I went through the Dynatrace documentation and I found out that I have to generate an API-token in order to get authenticated to extract data. I went ahead and did that and I have the token in hand now.
I then downloaded Postman and setup the environment based on some videos I watched. What I would like to do is get a list of all hosts in my environment so I can do some organizational stuff. I am using this get request (replacing the your-environment-id with the appropriate value):
https://{your-environment-id}.live.dynatrace.com/api/v1/entity/infrastructure/hosts
I am then adding the token from the webui to Postman by using the Authorization option "Bearer Token" and I am inputting the given token. When I run the get request I am getting:
"Unsupported authentication mechanism -> 'Bearer'."
Can anyone provide insight into what type of auth I should be using? I also tried API Key using "API-Token" as the key name and the token from the UI as the value.
Solved! Go to Solution.
22 Oct 2020 03:08 PM
I figured this out on my own. Under the "Headers" section in Postman for your query do the following:
It appears like the prepackaged authorization methods for Postman don't quite include the right type for the Dynatrace API so using those doesn't work.
22 Oct 2020 03:22 PM
You can access token values in postman from the authorization and headers section.
you can also hide the Key Value as well by clicking Header and selecting the '...'
I hope this helps 🙂