<?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: RequestToken invalid when contains + symbol in Dynatrace API</title>
    <link>https://community.dynatrace.com/t5/Dynatrace-API/RequestToken-invalid-when-contains-symbol/m-p/296741#M3968</link>
    <description>&lt;P&gt;Thank you so much Maximiliano, it's working! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 26 Mar 2026 11:31:13 GMT</pubDate>
    <dc:creator>Celine</dc:creator>
    <dc:date>2026-03-26T11:31:13Z</dc:date>
    <item>
      <title>RequestToken invalid when contains + symbol</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/RequestToken-invalid-when-contains-symbol/m-p/296734#M3966</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I use the grail service api to run DQL query from java client.&lt;BR /&gt;When i do a POST on&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;platform/storage/query/v1/query:execute&lt;BR /&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;I received a requestToken that I reuse in a query GET platform/storage/query/v1/query:poll (while state is Running).&lt;BR /&gt;It works excepted when the requestToken received contains a "+".&lt;BR /&gt;I got the error "The supplied request-token parameter (xxxxxxxxxxx xxxxxx==) is invalid".&lt;BR /&gt;I try to encode it but I got an error too:&amp;nbsp;The supplied request-token parameter (xxxxxxxxxxx%2Bxxxxxx==) is invalid.&lt;BR /&gt;How to fix it?&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 26 Mar 2026 09:46:33 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/RequestToken-invalid-when-contains-symbol/m-p/296734#M3966</guid>
      <dc:creator>Celine</dc:creator>
      <dc:date>2026-03-26T09:46:33Z</dc:date>
    </item>
    <item>
      <title>Re: RequestToken invalid when contains + symbol</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/RequestToken-invalid-when-contains-symbol/m-p/296739#M3967</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/102763"&gt;@Celine&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;This usually happens because the request-token is being treated as a URL query parameter, and in query strings a &lt;STRONG&gt;+&lt;/STRONG&gt; is often interpreted as a space if it isn’t handled correctly.&lt;/P&gt;&lt;P&gt;So when Dynatrace returns a token containing &lt;STRONG&gt;+&lt;/STRONG&gt;, you should make sure the token is passed as a properly encoded query parameter in the &lt;STRONG&gt;query:poll&lt;/STRONG&gt; call, and that it is encoded only once.&lt;/P&gt;&lt;P&gt;What to check on the Java side:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Do not build the URL by simple string concatenation&lt;/LI&gt;&lt;LI&gt;Do not send the raw token directly in the URL&lt;/LI&gt;&lt;LI&gt;Do not pre-encode it and then let the HTTP client encode it again&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;The safest approach is to use a URI/query parameter builder and pass the original token value to it, so the client handles encoding correctly.&lt;/P&gt;&lt;P&gt;In practice, the problem is often this:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;raw + becomes a space&lt;/LI&gt;&lt;LI&gt;Or %2B gets encoded again and the API receives the wrong value&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;So the fix is:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;keep the original &lt;STRONG&gt;requestToken&amp;nbsp;&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;add it as a query parameter with your HTTP client&lt;/LI&gt;&lt;LI&gt;let the client encode it once&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Maybe something like:&lt;/P&gt;&lt;LI-CODE lang="java"&gt;URI uri = new URIBuilder(baseUrl + "/platform/storage/query/v1/query:poll")
    .addParameter("request-token", requestToken)
    .build();&lt;/LI-CODE&gt;&lt;P&gt;I got the same problem when I was making a n8n automation, not with Java ofc, I suffered a little to got the solution &lt;span class="lia-unicode-emoji" title=":grinning_face_with_sweat:"&gt;😅&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know if helped, please&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2026 11:17:39 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/RequestToken-invalid-when-contains-symbol/m-p/296739#M3967</guid>
      <dc:creator>MaximilianoML</dc:creator>
      <dc:date>2026-03-26T11:17:39Z</dc:date>
    </item>
    <item>
      <title>Re: RequestToken invalid when contains + symbol</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/RequestToken-invalid-when-contains-symbol/m-p/296741#M3968</link>
      <description>&lt;P&gt;Thank you so much Maximiliano, it's working! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2026 11:31:13 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/RequestToken-invalid-when-contains-symbol/m-p/296741#M3968</guid>
      <dc:creator>Celine</dc:creator>
      <dc:date>2026-03-26T11:31:13Z</dc:date>
    </item>
    <item>
      <title>Re: RequestToken invalid when contains + symbol</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/RequestToken-invalid-when-contains-symbol/m-p/296742#M3969</link>
      <description>&lt;P&gt;My pleasure,&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/102763"&gt;@Celine&lt;/a&gt;&amp;nbsp;!&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2026 11:33:14 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/RequestToken-invalid-when-contains-symbol/m-p/296742#M3969</guid>
      <dc:creator>MaximilianoML</dc:creator>
      <dc:date>2026-03-26T11:33:14Z</dc:date>
    </item>
  </channel>
</rss>

