filmov
tv
How To Access Salesforce APIs using Python (SFDC Tutorial)
Показать описание
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
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
Комментарии