Postman shows JSON Body but KNIME GET Request only returns "?" when calling MicroStrategy REST API

Hi all,

I’m trying to call the MicroStrategy REST API from KNIME.
When I use Postman, I can successfully call the endpoint and see the JSON body in the response.

Example (works in Postman):

Get http://10.1.2.62:8080/MicroStrategyLibrary/api/searches/results?root=CB85AE4E407177A1C12BA1ACA162FE3C&type=3

Headers in Postman:

X-MSTR-AuthToken: <valid token>
X-MSTR-ProjectID: <project id>
type:3
offset:0

In Postman I get a 200 OK with the JSON body as expected.

However, when I configure the same call in KNIME GET Request node, I only get “?” in the response body.

  • If I use the root=... parameter, KNIME returns status 204 No Content.

  • If I use pattern=4, KNIME returns 401 Unauthorized, even though the exact same headers work fine in Postman.

I already checked that:

  • The X-MSTR-AuthToken is fresh (generated right before the call).

  • The X-MSTR-ProjectID is correct.

  • Headers are mapped to flow variables in KNIME (see screenshots).

  • Postman and KNIME are using the same URL and headers.

I have attached screenshots comparing the configuration in KNIME vs Postman and the different results.

Question:
Why does Postman correctly show the JSON body, but KNIME GET Request only returns “?” (or 401/204 depending on parameters)?
Is there something specific in KNIME’s GET Request node configuration (headers, encoding, body column, etc.) that I might be missing?

Thanks a lot for your help!

Hi,
I don’t have a solution but you might get some more info if you enable this option in the “Error Handling” tab:

1 Like

Hello,

After checking the error cause, I got the message shown in the screenshot.
It says “the user’s session has expired” – does this mean the MSTR token has expired?

That should not be the case, because I have already refreshed the token. I really don’t know what is going wrong here.

The URL I am currently using is:

http://10.1.2.62:8080/MicroStrategyLibrary/api/searches/results?root=CB85AE4E407177A1C12BA1ACA162FE3C&type=3&limit=50

Hi,

hmm seems like the token is not send correctly to the API. How do you pass it?
It should be send via the Request Headers, which you can edit in the “Request Headers” Pane.

Just click on “add header parameter” at the botton. Then enter the key “X-MSRT-AuthToken” and as the key the token.

I am calling POST /api/auth/login via a POST Request to obtain the MSTR token and then store it as a flow variable. Afterwards, I use a GET Request to call GET /api/searches/results.

The configuration is shown in the screenshot below. So in theory, the token ID and Project ID should not be incorrect, since I already tested with the same information in Postman and it worked successfully.
If needed, I can provide the workflow to you. Thank you.

Your configuration looks fine to me.

  • How long is the token valid?
  • Are you sure that theres no typo or a blank space at the end?

I dont have an account at Microstrategy therefore I cannot test it for you.

  1. The token does not expire, it just gets refreshed. I am not sure about the exact timing.
  2. I am certain that both the name and the content are correct.

In addition, I used a Python script to call the API, but the result and the error are the same as with the GET request.

Good news! When the error occurs in Python as well, the problem is definitely related to the request call and not to KNIME.

Is there a chance to get the raw statement from postman and compare it with the python/KNIME version?

2 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.