+ Start a Discussion
Hadas Kling 22Hadas Kling 22 

How to call REST service on Salesforce from Phyton


I am trying to call a REST service on Salesforce from Phyton and I keep on getting a message: Invalid session ID.
Can anyone help here?
How do I get a session ID?

Timothy Gentet O'BrienTimothy Gentet O'Brien
Take a look at the "Force.com REST API Developer Guide", there you can find the "Understanding Authentication (https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/intro_understanding_authentication.htm)" page, which should direct you to the relevant pages you will need to be abel to authenticate. With the way that Salesforce works you need to authenticate first, then use the returned Access Token in all subsequent calls.

The one you probably need is: Understanding the Username-Password OAuth Authentication Flow (https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/intro_understanding_username_password_oauth_flow.htm)