Create a custom app with OAuth 2.0 for authentication
Create a custom app in Salesforce and get the access token to interact with REST APIs.
Ensure you have the following to build the bot:
- A basic knowledge of REST API and an understanding of OAuth concepts.
- An account created in Salesforce and a user name and password available.
- Log in to Salesforce and click Switch to Lightning Experience.
- Click your Profile image and click Settings.
On the left side, click Reset My Security Token.
After resetting the token action, a new token is sent to your registered email.
- Check your email and save the security token.
- In the Salesforce application, click Home, and search and select App manager.
Click New Connected App:
- In the Connected App Name field, enter OAuth_Validation_App.
- In the Contact Email field, enter your email.
- In the API section, select Enable OAuth Settings.
- In the Callback URL field, enter no:callbackURL.
- In the Selected OAuth Scopes, select Access and manage your data (api).
- Click Add and verify that the Access and manage your data (api) is shown on the right side.
A system message is displayed: Allow from 2-10 minutes for your changes to take effect on the server before using the connected app.
- Wait until the changes are applied and then click Continue.
- When the OAuth_Validation_Apppage is displayed, go to the API section and copy the Consumer Key and Consumer Secret values. If it is hidden, select Click to reveal and copy the Consumer Secret key.
- Click Manage and validate the OAuth Policies: verify that the Permitted Users field includes All users may self-authorize. If not, click Edit Policies and select All users may self-authorize.
You can build a bot using the values from the OAuth_Validation_App, such as, ClientId = Consumer Key, ClientSecret = Consumer Secret, SecurityToken, and your SalesForce user name and password.
Build a bot using REST web services and String actions