forcedotcom / postman-salesforce-apis

Salesforce API Postman Collection
Creative Commons Zero v1.0 Universal
1.06k stars 638 forks source link

INVALID_SESSION_ID after successful SOAP login #46

Closed robindebondt closed 3 years ago

robindebondt commented 3 years ago

I was trying to follow the steps on this blog post. Instead of importing the workspace json, I forked the Salesforce APIs collection and Salesforce template environment from the public workspace.

I adapted the first 5 variables in the environment, and could successfully do a SOAP login call. At that point indeed, variables like _accesstoken are also getting filled in in the environment.

However, if I do any other call afterwards, I'm getting

[
    {
        "message": "Session expired or invalid",
        "errorCode": "INVALID_SESSION_ID"
    }
]

What am I doing wrong? I guess I still have to manually adapt some settings here (but then I don't really understand what the environment variables are doing):

image

robindebondt commented 3 years ago

Was able to resolve the issue thanks to some help from a Salesforce colleague who read about the issue on Twitter.

I was getting an invalid client id error when trying to generate a new access token. When hovering over the clientId, I saw it was using the environment variable scope. I then copy pasted the clientId value from the collection variable list into the environment variable and that did the trick.