Share Your Experience With Others

“Session expired or invalid”, in postman for salesforce request

The error message “Session expired or invalid” typically occurs when the authentication session between Postman and Salesforce has expired or become invalid.

Salesforce requires users to authenticate themselves before accessing its APIs. This authentication is typically done through OAuth 2.0, which generates an access token that is used to access the Salesforce APIs.

If the access token has expired or become invalid, you will see this error message in Postman. To resolve this issue, you can try the following steps:

  1. Refresh the access token: In Postman, go to the Salesforce request you are trying to run, and click on the “Authorization” tab. Click the “Get New Access Token” button to generate a new access token.
  2. Check the Salesforce session timeout: If the access token expires frequently, you may need to check the session timeout settings in Salesforce. By default, Salesforce sessions expire after two hours of inactivity.
  3. Verify the Salesforce authentication settings: Ensure that the authentication settings in Postman match the authentication settings in Salesforce. Verify that you have the correct client ID, client secret, and redirect URI.
  4. Check for any errors in the Salesforce API request: If the above steps do not resolve the issue, check for any errors in the Salesforce API request itself. There may be an error in the request that is causing the session to expire or become invalid.
  5. Check you are using the correct instance_url in your request. Easy way to find the correct url is when you get new access token it will be mention there.

Leave a comment