HTTP Request inside loop JWT token

Hi,

Good day! I’m having an issue inside my loop where I can’t get the bearer token outside of it on http request.

request failed (type: HTTP Response Returned a Client Error, retryable: false): request failed: 401 - 401 Unauthorized - {"error":"JWT is required"}"

My request header is Authorization {{$.httprequest.body.BearerToken}}

at the top http request will show the output of {{$.httprequest.body.BearerToken}} like Bearer 123…

Can you try passing $ in the loop context and use {{$.loop.context.httprequest.body.BearerToken}}.

Hello,

It’s not working. I tried {{$.loop.context.httprequest.body.BearerToken}}

my loop input is

$.hTTPRequest1.body[0].access[?(@.type == “ENTITLEMENT” && @.source.name == “my source”")]

Your Authorization should be as below:

Authorization Bearer {{$.httprequest.body.BearerToken}}
image

Can you share your workflow json?

What is the loop context ?

Hi,

I was able to resolve the issue by using the client ID and client secret from the PAT, as I was using them in API Management before.

Thanks!

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