function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Hadas Kling 22Hadas Kling 22 

How to call REST service on Salesforce from Phyton

Hi,

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?

Thanks,
Hadas
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)