<?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: query:execute resulting in a 404 in Developer Q&amp;A Forum</title>
    <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/query-execute-resulting-in-a-404/m-p/304653#M1713</link>
    <description>&lt;P&gt;Hi coder33, This is a common gotcha: query:execute lives under /platform/... on apps.dynatrace.com, which is a "Platform API," and Platform APIs only accept an OAuth2 Bearer token from an OAuth client — they do not accept a classic API-Token, even though the Api-Token scheme works fine for classic environment APIs like api/v2/logs/ingest.&lt;/P&gt;&lt;P&gt;So the fact that your token works for logs/ingest but not for query:execute is expected, not a bug: those two endpoints are on different API layers with different auth requirements.&lt;/P&gt;&lt;P&gt;To fix it:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Create an OAuth client (Account Management &amp;gt; Identity &amp;amp; access management &amp;gt; OAuth clients, or in some tenants under Settings).&lt;/LI&gt;&lt;LI&gt;Grant it the IAM permissions your query needs, for example storage:buckets:read and storage:logs:read (add others depending on what you are querying, such as storage:events:read or storage:metrics:read).&lt;/LI&gt;&lt;LI&gt;Get an access token via the client_credentials grant from the SSO token endpoint.&lt;/LI&gt;&lt;LI&gt;Call query:execute with "Authorization: Bearer &amp;lt;access_token&amp;gt;" instead of "Authorization: Api-Token &amp;lt;token&amp;gt;".&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;There's a similar solved thread here that confirms the exact same pattern for the OpenPipeline API, which is architecturally the same kind of platform endpoint: community.dynatrace.com/t5/Dynatrace-API/Platform-API-authentication-with-access-tokens-support/td-p/264055&lt;/P&gt;&lt;P&gt;One thing worth double-checking on your side: some platform gateways return 404 rather than 401 when the token type/scheme is wrong on that route, so a 404 here doesn't necessarily mean the URL is wrong — it can also mean auth is being rejected before it even reaches the query service. Worth checking the raw response body/headers to see if there's a message like "Unsupported authorization scheme" hiding in there.&lt;/P&gt;&lt;P&gt;Hope that helps!&lt;/P&gt;</description>
    <pubDate>Tue, 22 Sep 2026 17:43:41 GMT</pubDate>
    <dc:creator>julsgs</dc:creator>
    <dc:date>2026-09-22T17:43:41Z</dc:date>
    <item>
      <title>query:execute resulting in a 404</title>
      <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/query-execute-resulting-in-a-404/m-p/304645#M1712</link>
      <description>&lt;P&gt;I am trying to query the logs using Grail.&amp;nbsp; I am calling "&lt;A href="https://{environmentid}.apps.dynatrace.com/platform/storage/query/v1/query:execute&amp;quot;" target="_blank"&gt;https://{environmentid}.apps.dynatrace.com/platform/storage/query/v1/query:execute"&lt;/A&gt;&amp;nbsp;and the response is a 404.&amp;nbsp; I am using the same request body that works just fine from swagger.&amp;nbsp; Also, the access token that gives 404 for "query:execute" seems to be working fine for "api/v2/logs/ingest".&amp;nbsp; Any ideas what I am doing wrong?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{"error":{"code":404,"message":"Not found","errorDetails":[]}}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Sep 2026 13:45:51 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Developer-Q-A-Forum/query-execute-resulting-in-a-404/m-p/304645#M1712</guid>
      <dc:creator>coder33</dc:creator>
      <dc:date>2026-09-22T13:45:51Z</dc:date>
    </item>
    <item>
      <title>Re: query:execute resulting in a 404</title>
      <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/query-execute-resulting-in-a-404/m-p/304653#M1713</link>
      <description>&lt;P&gt;Hi coder33, This is a common gotcha: query:execute lives under /platform/... on apps.dynatrace.com, which is a "Platform API," and Platform APIs only accept an OAuth2 Bearer token from an OAuth client — they do not accept a classic API-Token, even though the Api-Token scheme works fine for classic environment APIs like api/v2/logs/ingest.&lt;/P&gt;&lt;P&gt;So the fact that your token works for logs/ingest but not for query:execute is expected, not a bug: those two endpoints are on different API layers with different auth requirements.&lt;/P&gt;&lt;P&gt;To fix it:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Create an OAuth client (Account Management &amp;gt; Identity &amp;amp; access management &amp;gt; OAuth clients, or in some tenants under Settings).&lt;/LI&gt;&lt;LI&gt;Grant it the IAM permissions your query needs, for example storage:buckets:read and storage:logs:read (add others depending on what you are querying, such as storage:events:read or storage:metrics:read).&lt;/LI&gt;&lt;LI&gt;Get an access token via the client_credentials grant from the SSO token endpoint.&lt;/LI&gt;&lt;LI&gt;Call query:execute with "Authorization: Bearer &amp;lt;access_token&amp;gt;" instead of "Authorization: Api-Token &amp;lt;token&amp;gt;".&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;There's a similar solved thread here that confirms the exact same pattern for the OpenPipeline API, which is architecturally the same kind of platform endpoint: community.dynatrace.com/t5/Dynatrace-API/Platform-API-authentication-with-access-tokens-support/td-p/264055&lt;/P&gt;&lt;P&gt;One thing worth double-checking on your side: some platform gateways return 404 rather than 401 when the token type/scheme is wrong on that route, so a 404 here doesn't necessarily mean the URL is wrong — it can also mean auth is being rejected before it even reaches the query service. Worth checking the raw response body/headers to see if there's a message like "Unsupported authorization scheme" hiding in there.&lt;/P&gt;&lt;P&gt;Hope that helps!&lt;/P&gt;</description>
      <pubDate>Tue, 22 Sep 2026 17:43:41 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Developer-Q-A-Forum/query-execute-resulting-in-a-404/m-p/304653#M1713</guid>
      <dc:creator>julsgs</dc:creator>
      <dc:date>2026-09-22T17:43:41Z</dc:date>
    </item>
  </channel>
</rss>

