<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: token error using API &amp;quot;401 could not parse JWT&amp;quot; in Dynatrace API</title>
    <link>https://community.dynatrace.com/t5/Dynatrace-API/token-error-using-API-quot-401-could-not-parse-JWT-quot/m-p/297416#M3982</link>
    <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;While we have classic API's that just need API token to access [*.live.com], GRAIL API's are part of the Gen3 Platform(*.apps.*) in Dynatrace and need OAuth2.0 to access them.&lt;BR /&gt;You should try creating a token via below method and see if it works.&lt;BR /&gt;&lt;A href="https://developer.dynatrace.com/develop/guides/access-platform-apis-from-outside/" target="_blank"&gt;Access platform APIs from outside | Dynatrace Developer&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Another way is to get a platform token for &lt;SPAN&gt;programmatic&lt;/SPAN&gt; access:&lt;BR /&gt;&lt;A href="https://docs.dynatrace.com/docs/shortlink/platform-tokens" target="_blank"&gt;https://docs.dynatrace.com/docs/shortlink/platform-tokens&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 09 Apr 2026 05:11:17 GMT</pubDate>
    <dc:creator>RohitBisht</dc:creator>
    <dc:date>2026-04-09T05:11:17Z</dc:date>
    <item>
      <title>token error using API "401 could not parse JWT"</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/token-error-using-API-quot-401-could-not-parse-JWT-quot/m-p/297406#M3980</link>
      <description>&lt;P&gt;Performing what should be a simple DQL query via API, I get a 401 - Could not parse JWT".&amp;nbsp; &amp;nbsp;I understand this to be an token issue.&lt;/P&gt;
&lt;P&gt;The confusion is that the token is fully usable in a different api call.&amp;nbsp; (I intentionally over-provisioned the token giving ALL 38 scopes)&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The failing query works in the swagger test -- unless I explicitly provide a token instead of my login.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I do recognize there is a difference (which I don't still fully understand) in the "live" vs "apps" url,&amp;nbsp; SHould I be using a different form of token?&amp;nbsp; If so, can I get guided to it? THank you in advance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;THIS CODE WORKS:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="java"&gt;$ApiToken = "dt0c01.REDACTED"
$Uri = "https://{environmentid}.apps.dynatrace.com/platform/storage/query/v1/query:execute?enrich=metric-metadata"

$Body = @"
{
  "defaultSamplingRatio": 1,
  "defaultScanLimitGbytes": 10,
  "defaultTimeframeEnd": "2026-04-08T00:00:00.000Z",
  ... TRIMMED, not directly relevant ....
}
"@

$DQLQuery = Invoke-RestMethod -Uri $MetaUrl -Headers $Headers -Method POST -Body $Body
$DQLQuery | ConvertTo-Json -Depth 99 | Out-File -FilePath "C:\temp\DQLQuery.json" -Encoding UTF8
Write-Host "DQLQuery response saved to C:\temp\DQLQuery.json"&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Apr 2026 12:04:00 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/token-error-using-API-quot-401-could-not-parse-JWT-quot/m-p/297406#M3980</guid>
      <dc:creator>dcbarry</dc:creator>
      <dc:date>2026-04-09T12:04:00Z</dc:date>
    </item>
    <item>
      <title>Re: token error using API "401 could not parse JWT"</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/token-error-using-API-quot-401-could-not-parse-JWT-quot/m-p/297416#M3982</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;While we have classic API's that just need API token to access [*.live.com], GRAIL API's are part of the Gen3 Platform(*.apps.*) in Dynatrace and need OAuth2.0 to access them.&lt;BR /&gt;You should try creating a token via below method and see if it works.&lt;BR /&gt;&lt;A href="https://developer.dynatrace.com/develop/guides/access-platform-apis-from-outside/" target="_blank"&gt;Access platform APIs from outside | Dynatrace Developer&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Another way is to get a platform token for &lt;SPAN&gt;programmatic&lt;/SPAN&gt; access:&lt;BR /&gt;&lt;A href="https://docs.dynatrace.com/docs/shortlink/platform-tokens" target="_blank"&gt;https://docs.dynatrace.com/docs/shortlink/platform-tokens&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Apr 2026 05:11:17 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/token-error-using-API-quot-401-could-not-parse-JWT-quot/m-p/297416#M3982</guid>
      <dc:creator>RohitBisht</dc:creator>
      <dc:date>2026-04-09T05:11:17Z</dc:date>
    </item>
  </channel>
</rss>

