Skip to Content
2 days ago

Salesforce REST API 401 - Access Token

43 Views Last edit 2 days ago 4 rev


My scenario is to pull data from Salesforce by calling the Query REST API. As you may know, it requires an access token which is passed into the Authorization header. In Postman (as shown below), it works perfectly fine.

This is how I modelled it in the iFlow - using Groovy script to set the access token Bearer Authorization header.

Problem is, I always get a 401 error.

I've also done the following:

- Runtime Configuration - HTTP Session Reuse: On Integration Flow

- Used Content Modifier instead of script to set / hardcode the headers

Any idea what might be going on here? I've pretty much done the same thing with my other iFlows that call APIs with bearer access token and I never had this problem.

Appreciate any tips. Thanks!


capture.png (51.5 kB)
capture.png (35.3 kB)
capture1.png (65.7 kB)