05 Mar 2020 10:43 AM - last edited on 27 Apr 2021 09:36 AM by MaciejNeumann
Hi all,
calling the REST API I'm gettin this response:
{"error":{"code":401,"message":"Unsupported authentication mechanism -> 'Basic', could not be used as fallback."}}
The request was something like this:
Putting this request in my browser works fine but from curl in another machine I'm getting the "Unsupported authentication mechanism" message.
My suspicion is that dynatrace, in the second case, is not receiving the Api-Token parameter well for some reason, so where can I see the request that is coming to Dynatrace in order to verify id the Api-Token parameter is coming correctly?
Regards, Josep Maria
Solved! Go to Solution.
05 Mar 2020 10:59 AM
You cannot see on Dynatrace site requests that are executed via API. About using curl, maybe you have something wrong in headers, because Basic auth mentioned here is in header. In general you don't have to pur token in url you can put it in header:
https://www.dynatrace.com/support/help/shortlink/api-authentication#authenticate
Here you have proper example for curl.
Sebastian
05 Mar 2020 11:46 AM
Hi Sebastian,
thanks for your response, the problem in this case was in CURL with the dashboard timeframe especified between the URI and the Api-Token parameter:
The URL was https://wxv699.dynatrace-managed.com/e/6fa686ce-5f7e-4a27-a076-1e86dd547c9c/api/config/v1/dashboards...
CURL doesn't understand the ;gtf=l_2_HOURS;gf=all part and doesn't send de Api-Token to the server.
So, how can specify the timeframe in order to work well with CURL?
Regards, Josep Maria
05 Mar 2020 11:47 AM