cancel
Showing results for 
Search instead for 
Did you mean: 

Salesforce REST API 401 - Access Token

markbernabe
Active Participant
0 Kudos

Hi,

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!

Accepted Solutions (1)

Accepted Solutions (1)

markbernabe
Active Participant

Hi all,

Problem solved after adding 'Authorization" in the Request Headers under the Header details of the HTTP Receiver adapter. 🙂

Answers (0)