0

Goal : configure Salesforce to enable an external system to use SF APIs. I am fully discovering the full picture and i am missing pieces..

I created a connected app, enabling API. In postman desktop, I downloaded the SF collections and i created an hopefully 'forever token' using oAuth2 and got a response. I tested the access token selecting Bearer token and {{_endpoint}}/services/data/v{{version}}/limits/recordCount?sObjects=Account,Contact,Lead

This worked fine Now i send over the token to the external system guys and in postman ( they don't have the SF collection) but they tried the same {{_endpoint}}/services/data/v{{version}}/limits/recordCount?sObjects=Account,Contact,Lead

And immediately get "message": "Session expired or invalid","errorCode": "INVALID_SESSION_ID".

i then retried on my desktop postman all was working so i tried on Web postman in an anonymous window and also get "message": "Session expired or invalid","errorCode": "INVALID_SESSION_ID".

So My question is what am i doing wrong? have i forgotten a setting somewhere? a little tick somewhere? ( i did try to set the 'Follow auth Header ' on in Settings but same error output)

Any input welcome. Web view

enter image description here

Desktop view enter image description here

4
  • I was typing out an answer about how access tokens do expire, but the I re-read the question and it working for you in postman (Desktop) but not postman (Web) is odd. Are you sure you're setting the {{_endpoint}} and {{version}} variables correctly? Are you typing the header name correctly? Some screenshots of your two postman setups (with sensitive information blacked out, naturally) would probably be helpful.
    – Derek F
    Commented Jan 27 at 15:59
  • Thanks for your answer @Derek. So the process I followed so far is correct then since you didn't ask questions about that ( connected app + creation of token via Oauth 2 providing consumer and secret) . If so i will review the variables but i triple checked them already and i keep getting that annoying error, hopefully i'll spot an error.. Now though i do have a question about the access token that expire.. how can I provide some token once for all, i don't understand the refresh token concept..
    – Langloic
    Commented Jan 27 at 17:09
  • I added 2 screen shots, not sure they say much. When you said 'Are you typing the header name correctly?' Where does that go as i didn't type any header name anywhere so this could be my issue.
    – Langloic
    Commented Jan 27 at 17:52
  • @Langloic have you managed to resolve this ? I'm struggling with the same right now :) Commented Aug 8 at 11:15

1 Answer 1

0

The Overview section of the Salesforce Platform APIs Postman collection says

If using Postman Web UI, follow these steps to set up CORS in your Salesforce Org. This is not required when working with the Postman Desktop app.

So that explains why you're seeing a difference between Postman Web and Desktop. Not sure about the other part.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .