3rd Party app needs to access Salesforce resources without user interaction. I am trying to use OAuth refresh token - Refresh token . I generated an access token and a refresh token using postman and I subsequently use the above generated refresh token to get a new access token like hitting url- https://test.salesforce.com/services/oauth2/token?grant_type=refresh_token&client_id={Client Id Value from connected app}&client_secret={Client Secret value from Connected app} &refresh_token={refresh token value} This returns the response as

   <access_token>          00DQ000000GKmTTAQUAQKncOXXXXXXXXXXXXXXXXXXXXXXXXXXX9M55Ilp.kiXvgigce_we1Vv5m298ZThgKLZBbPF50CG7S30laMc 
      https://test.salesforce.com/id/00DQ000000TYmTMA1/{My Salesforce User id} 

Now I use https://MyInstanceURL.salesforce.com/services/apexrest/bulkrequest with authorization as: OAuth {Access token} , it gives 401 error. Even with the postman I get the same error. I checked all the configurations in the connected app, it looks fine. Scope in the connected app has all the relevant values. What I am missing? Can it be related to my salesforce user access to the connected app? My profile has 'API enabled' permission. Also, when requesting new access token using refresh token, what is the significance of the Salesforce User Id returned in the response along with the org id?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.