# Unsupported authentication mechanism error

**URL:** <https://community.dynatrace.com/t/unsupported-authentication-mechanism-error/18675>\
**Category:** Real User Monitoring\
**Tags:** application-monitoring, dynatrace-api\
**Created:** [March 5, 2020, 10:43am UTC](https://community.dynatrace.com/t/unsupported-authentication-mechanism-error/18675 "2020-03-05T10:43:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jcamps](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/jcamps/32/6791_2.png) [@jcamps](https://community.dynatrace.com/u/jcamps)\
**Post date:** [March 5, 2020, 10:43am UTC](https://community.dynatrace.com/t/unsupported-authentication-mechanism-error/18675/1 "2020-03-05T10:43:48Z")

</div>

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:

[https://wxv699.dynatrace-managed.com/e/6fa686ce-5f7e-4a27-a076-1e86dd547c9c/api/config/v1/dashboards/38880a32-d156-406e-b197-7a9c189d94e5;gtf=l\_2\_HOURS;gf=all?Api-Token=XXXX](https://wxv699.dynatrace-managed.com/e/6fa686ce-5f7e-4a27-a076-1e86dd547c9c/api/config/v1/dashboards/38880a32-d156-406e-b197-7a9c189d94e5;gtf=l_2_HOURS;gf=all?Api-Token=YOXzvF1YSyawl1gcBZlL6)

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

---

<div class="post-metadata">

**Author:** ![skrystosik](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/skrystosik/32/21133_2.png) [@skrystosik](https://community.dynatrace.com/u/skrystosik)\
**Post date:** [March 5, 2020, 10:59am UTC](https://community.dynatrace.com/t/unsupported-authentication-mechanism-error/18675/2 "2020-03-05T10:59:55Z")

</div>

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:

> **[Dynatrace API - Tokens and authentication](https://docs.dynatrace.com/docs/dynatrace-api/basics/dynatrace-api-authentication)**
>
> Find out how to get authenticated to use the Dynatrace API.

Here you have proper example for curl.

Sebastian

---

<div class="post-metadata">

**Author:** ![jcamps](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/jcamps/32/6791_2.png) [@jcamps](https://community.dynatrace.com/u/jcamps)\
**Post date:** [March 5, 2020, 11:46am UTC](https://community.dynatrace.com/t/unsupported-authentication-mechanism-error/18675/3 "2020-03-05T11:46:06Z")

</div>

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:

 ![23971-1.jpg](https://global.discourse-cdn.com/dynatrace/original/1X/ce5ba17c398eb7661fd906056f0b54fa79416cf3.jpeg)

The URL was [https://wxv699.dynatrace-managed.com/e/6fa686ce-5f7e-4a27-a076-1e86dd547c9c/api/config/v1/dashboards/38880a32-d156-406e-b197-7a9c189d94e5\*\*;gtf=l\_2\_HOURS;gf=all\*\*?api-token=XXXXX](https://wxv699.dynatrace-managed.com/e/6fa686ce-5f7e-4a27-a076-1e86dd547c9c/api/config/v1/dashboards/38880a32-d156-406e-b197-7a9c189d94e5;gtf=l_2_HOURS;gf=all?api-token=YOXzvF1YSyawl1gcBZlL6)

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

---

<div class="post-metadata">

**Author:** ![skrystosik](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/skrystosik/32/21133_2.png) [@skrystosik](https://community.dynatrace.com/u/skrystosik)\
**Post date:** [March 5, 2020, 11:47am UTC](https://community.dynatrace.com/t/unsupported-authentication-mechanism-error/18675/4 "2020-03-05T11:47:40Z")

</div>

As I said, put your token into header and you will not have problems with params in url.

---

<div class="post-metadata">

**Author:** ![jcamps](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/jcamps/32/6791_2.png) [@jcamps](https://community.dynatrace.com/u/jcamps)\
**Post date:** [March 5, 2020, 3:26pm UTC](https://community.dynatrace.com/t/unsupported-authentication-mechanism-error/18675/5 "2020-03-05T15:26:52Z")

</div>

Thanks Sebastian!
