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!