# RequestToken invalid when contains + symbol

**URL:** <https://community.dynatrace.com/t/requesttoken-invalid-when-contains-symbol/55373>\
**Category:** Dynatrace API\
**Tags:** dynatrace-api\
**Created:** [March 26, 2026, 9:46am UTC](https://community.dynatrace.com/t/requesttoken-invalid-when-contains-symbol/55373 "2026-03-26T09:46:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Celine](https://avatars.discourse-cdn.com/v4/letter/c/13edae/32.png) [@Celine](https://community.dynatrace.com/u/Celine)\
**Post date:** [March 26, 2026, 9:46am UTC](https://community.dynatrace.com/t/requesttoken-invalid-when-contains-symbol/55373/1 "2026-03-26T09:46:33Z")

</div>

Hi,

I use the grail service api to run DQL query from java client.  
When i do a POST on

```auto
platform/storage/query/v1/query:execute

```

I received a requestToken that I reuse in a query GET platform/storage/query/v1/query:poll (while state is Running).  
It works excepted when the requestToken received contains a “+”.  
I got the error “The supplied request-token parameter (xxxxxxxxxxx xxxxxx==) is invalid”.  
I try to encode it but I got an error too: The supplied request-token parameter (xxxxxxxxxxx%2Bxxxxxx==) is invalid.  
How to fix it?

---

<div class="post-metadata">

**Author:** ![MaximilianoML](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/maximilianoml/32/25038_2.png) [@MaximilianoML](https://community.dynatrace.com/u/MaximilianoML)\
**Post date:** [March 26, 2026, 11:17am UTC](https://community.dynatrace.com/t/requesttoken-invalid-when-contains-symbol/55373/2 "2026-03-26T11:17:39Z")

</div>

Hello&nbsp;[@Celine](https://community.dynatrace.com/user/102763)&nbsp;,

This usually happens because the request-token is being treated as a URL query parameter, and in query strings a **+** is often interpreted as a space if it isn’t handled correctly.

So when Dynatrace returns a token containing **+** , you should make sure the token is passed as a properly encoded query parameter in the **query:poll** call, and that it is encoded only once.

What to check on the Java side:

- Do not build the URL by simple string concatenation
- Do not send the raw token directly in the URL
- Do not pre-encode it and then let the HTTP client encode it again

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.

In practice, the problem is often this:

- raw + becomes a space
- Or %2B gets encoded again and the API receives the wrong value

So the fix is:

1. keep the original **requestToken**
2. add it as a query parameter with your HTTP client
3. let the client encode it once

Maybe something like:

```java
URI uri = new URIBuilder(baseUrl + "/platform/storage/query/v1/query:poll")
    .addParameter("request-token", requestToken)
    .build();

```

I got the same problem when I was making a n8n automation, not with Java ofc, I suffered a little to got the solution 😅

Let me know if helped, please

---

<div class="post-metadata">

**Author:** ![Celine](https://avatars.discourse-cdn.com/v4/letter/c/13edae/32.png) [@Celine](https://community.dynatrace.com/u/Celine)\
**Post date:** [March 26, 2026, 11:31am UTC](https://community.dynatrace.com/t/requesttoken-invalid-when-contains-symbol/55373/3 "2026-03-26T11:31:13Z")

</div>

Thank you so much Maximiliano, it’s working! 🙂

---

<div class="post-metadata">

**Author:** ![MaximilianoML](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/maximilianoml/32/25038_2.png) [@MaximilianoML](https://community.dynatrace.com/u/MaximilianoML)\
**Post date:** [March 26, 2026, 11:33am UTC](https://community.dynatrace.com/t/requesttoken-invalid-when-contains-symbol/55373/4 "2026-03-26T11:33:14Z")

</div>

My pleasure,&nbsp;[@Celine](https://community.dynatrace.com/user/102763)&nbsp;!
