How To Access Salesforce APIs using Python (SFDC Tutorial)

preview_player
Показать описание
Access Salesforce GET requests to retrieve customer details, and metadata with Python.

Link to source code:

Accessing SFDC APIs is going to be pretty similar to the Supercoach web scraping video, in that we’re again, trying to create an OAuth2 access token which will give us permission to access Salesforce API GET requests.

If we tried to access those GET requests without a token, we’d basically receive an authorisation error.

In order to generate that token, we need to get our Client Id, Client Secret, and Authorisation URL, which can be done by creating a Connected App in Salesforce. Once you’re logged in, go to:
- Setup, Apps, App Manager, New Connected App
- Give your connected app a name, and contact email
- Tick Enable OAuth Settings
- Provide a callback URL which can be anything – even Localhost
- Select the OAuth scope you’d like to access – for now, select everything
- Click Save and Continue

Note down the:
- Consumer Key which is the Client ID,
- Consumer Secret which is our Client Secret, and
- Callback URL.

Then click:
- Manage
- Edit Policies
- Ensure that Permitted Users is set to All users may self-authorize
- And IP Relaxation is set to Relax IP restrictions.
- Depending on your organisation, you may have to leave it as Enforce IP restrictions, butthen whitelist the IP addresses under Network Access.
- Click Save, and the hard part is done!
- Replace the input variables with your own details
Рекомендации по теме
Комментарии
Автор

Thank you, this was really super quick and helpful :)

DurandalLM
Автор

I dont have this button "App Manager". How can I add it?

nikolaypodolian
Автор

Great video on how to making a Salesforce REST API call in Python.

jiejenn
Автор

I cannot see "App Manager". Is it possible that my account does not have rights to work on that menu?

iggymach
Автор

When I run the code, res = requests.get(url, headers=auth) produces 401 response. What should I do?

chanchongmeng
Автор

I'm getting error while working with Salesforce and python. Can you help to resolve this issue. It showing user locked message every time

johnrobertcool
Автор

If I want to pull data from contact, what should I change in url?

venkykolluri
Автор

how to change salesforce users password using python script

ramyalakshmanan
Автор

Am I the only one who came here from tiktok 😁

prii_rana