Salesforce
Salesforce is a customer relationship management (CRM) platform. It helps in marketing, sales, and commerce. Service and IT teams can work together as one from anywhere.
- 1 Authorization
- 1.1.1 Basic Auth
- 1.1.2 OAuth 2.0
- 1.2 Salesforce Connections
- 1.2.1 Salesforce Basic Connection
- 1.2.2 Salesforce OAuth 2.0
- 2 Actions
- 2.1 Create Opportunity
- 2.1.1 Output Example Payload
- 2.2 Get Leads
- 2.3 Get Lead by ID
- 2.4 Create Contact in Salesforce
- 2.4.1 Output Example Payload
- 2.5 Get Contacts
- 2.6 Get Contact by Id
- 2.7 Create Users in Salesforce
- 2.8 Get User by ID
- 2.9 Create Case
- 2.10 Get Cases
- 2.11 Get Case by Id
- 2.12 Get Contracts
- 2.13 Get Contract by Id
- 2.14 Get Accounts
- 2.15 Create Account
- 2.16 Get Opportunities in Salesforce
- 2.17 Get User-Owner Info
- 2.18 Get Account details by Id
- 2.19 Update Accounts
- 2.1 Create Opportunity
Authorization
The Salesforce component supports Basic Auth and OAuth 2.0.
Basic Auth
If the user selects Basic Auth, they will need to provide both their Salesforce username and password. Depending on the user's Salesforce setup, the password may have a security token attached to it. If security tokens in the Salesforce account are disabled, the user needs to add their Salesforce password. If security tokens are enabled in the user's Salesforce account, then enter the concatenation of the password and the security token.
For example, if the user's Salesforce password is p@$sw0rD
and the security token that Salesforce provides is ExAmPlE0000000000ExAmPlE
, then the user should enter p@$sw0rDExAmPlE0000000000ExAmPlE
as the user's password in Sapper. The user can manage security tokens by clicking their profile picture on the top-right of their Salesforce account, selecting My Settings, and then opening Personal -> Reset My Security Token.
OAuth 2.0
If the user selects OAuth 2.0, they will need to create and configure a Connected App within Salesforce. When a user creates a "Connected App", be sure to check Enable OAuth Settings and enter Sapper's OAuth callback URL - Sapper- as a Callback URL. Consult Salesforce to determine the proper OAuth Scopes to assign. To grant integrations the same permissions that the user authentication through OAuth has, select Full access (full). Select Require Secret for Web Server Flow and Require Secret for Refresh Token Flow:
Once the app has been created, the user will be provided with a Consumer Key and Consumer Secret. Take note of these keys:
Now, configure OAuth 2.0 settings in Sapper. Create a new credential of type OAuth 2.0 - Authorization Code.
For Client ID and Client Secret, enter the Consumer Key and Consumer Secret that the user previously noted
Leave Scopes blank
For Authorization URL, enter https://login.salesforce.com/services/oauth2/authorize
For Access Token URL, enter https://user's-COMPANY.my.salesforce.com/services/oauth2/token,then replace the user's-COMPANY with the user's Salesforce URL.
Users will now be able to authenticate a user through Salesforce using OAuth 2.0.
Salesforce Connections
Salesforce Basic Connection
Input | Key | Description | Example |
Select Application | application | Select Salesforce application |
|
Connection Mode | Mode | Mention the mode of connection | Custom |
Connection type | connection type | Select the type of connection. |
|
REST Connection Type | rest connection type | Select the type of REST connection. |
|
Connection Name | name | Provide a name for the connection. |
|
Connection Description | description | Describe the connection. |
|
Host Name | host | Provide a string value for the URL of the user's Select Salesforce application account. |
|
Username | username | Provide a valid username for the given Select Salesforce application account user want to connect. | exampleUser |
Password | password | Provide a password to authenticate all requests. Cloud users need to generate an API token for this value. | exampleSecurePassword |
Header Field | header | Provide the path of the endpoint for authentication. |
|
Header Prefix | header prefix | Select the header prefix - |
|
Salesforce OAuth 2.0
Input | Key | Description | Example |
Select Application | application | Select Salesforce application |
|
Connection Mode | Mode | Mention the mode of connection | Custom |
Connection type | connection type | Select the type of connection. |
|
REST Connection Type | rest connection type | Select the type of REST connection. |
|
Connection Name | name | Provide a name for the connection. |
|
Connection Description | description | Provide a description of the connection. |
|
Host Name | host | Provide a string value for the URL of the user's Salesforce account. |
|
Grant Type | grant type | Provide the grant type - Authorization code, Password, Client Credentials. |
|
Actions
Create Opportunity
Create a Salesforce Opportunity Record, which is a sale or pending deal | key: createOpportunity
Input | notes | Description | Example |
---|---|---|---|
Name | Name | Provide the Name of the object | myExampleObject |
Description | description | Provide a string value for the description of the object |
|
Stage | stage | The stage the sale is currently in. | Prospecting |
Close Date | closeDate | The date the sale will close. | YYYY-MM-DD |
Output Example Payload
{ "data": { "id": "06Q606ExampleId", "success": true }}
Get Leads
Get information about lead list | key: getLeads
Get Lead by ID
Get information about Lead through Id | key: getLeadbyList
Create Contact in Salesforce
Create a Salesforce contact | key: createContact
Input | Key | Description | Example |
---|---|---|---|
First Name | firstName | The first name of the contact at the company | John |
Last Name | lastName | The last name of the contact at the company | Smith |
Email Address | The email address for the object | ||
Company | company | Provide the company name |
|
Phone | phone | The primary phone number for the object | 18005555555 |
OwnerID | ID | Provide the owner ID |
|
Country | Code | Provide the country name and code |
|
Output Example Payload
{ "data": { "id": "06Q606ExampleId", "success": true }}
Get Contacts
Get information about contact list | key: getContacts
Get Contact by Id
Get information about contact through Id | key: getContactbyId
Input | Key | Description | Example |
---|---|---|---|
ID | contactId | The contact Id for the object | 62508 |
Create Users in Salesforce
Create a Salesforce user | key: createUser
Input | Key | Description | Example |
---|---|---|---|
User Name | userName | Mention name of the user |
|
Time Zone Sid Key | timezonesidkey | This field is a restricted picklist field. A User time zone affects the offset used when displaying or entering times in the user interface. But the API doesn’t use a User time zone when querying or setting values. | America/Chicago |
Alias | Alias | The user’s alias. For example, jsmith. | Holster |
First Name | firstName | The first name of the contact at the company | John |
Last Name | lastName | The last name of the contact at the company | Smith |
Email Address | The email address for the object | ||
Phone | phone | The contact number for the object | +1 999-999-9999 |
Profile ID | profileId | The owner Id for the object |
|
Language Locale Key | LanguageLocaleKey | The user’s language, such as French or Chinese (Traditional). Label is Language. | en_US |
Email Encoding Key | EmailEncodingKey | The email encoding for the user, such as ISO-8859-1 or UTF-8. | UTF-8 |
Locale’s id Key | LocaleSidKey | This field is a restricted picklist field. The value of the field affects formatting and parsing of values, especially numeric values, in the user interface. It doesn’t affect the API. | en_US |
Get User by ID
Get information about user through Id | key: getUserById
Input | Key | Description | Example |
---|---|---|---|
ID | useId | The user Id for the object |
|
Create Case
Create a Salesforce case | key: createCase
Input | Key | Description | Example |
---|---|---|---|
Account ID | accountId | The account Id for the object |
|
Status | status | The status for the object |
|
Subject | subject | The subject for the object |
|
Priority | priority | The priority for the object |
|
Description | description | The description for the object |
|
OwnerId | ownerId | The owner Id for the object |
|
Get Cases
Create a Salesforce case list | key: createCases
Get Case by Id
Get information about the case through Id | key: getCasebyId
Input | Key | Description | Example |
---|---|---|---|
ID | caseId | The case Id for the object |
|
Get Contracts
Get information about contact List | key: getContracts
Get Contract by Id
Get information about contact List | key: getContractbyId
Input | Key | Description | Example |
---|---|---|---|
ID | contactId | The contact Id for the object |
|
Get Accounts
Get information about account List | key: getAccounts
Create Account
Create account | key: createAccount
Input | Key | Description | Example |
---|---|---|---|
Name | name | Provide the account name. | Sample |
Phone Number | phoneNo | Mention the phone number of the user. | +14842918692 |
Get Opportunities in Salesforce
Get opportunities in Salesforce| key: getOpportunities
Get User-Owner Info
Get user-owner info| key: getUserOwner
Get Account details by Id
Get information about the account by Id | key: getAccountbyId
Input | Key | Description | Example |
---|---|---|---|
ID | accountId | The account Id for the object | 001 55 0 0000WO1Zi AAL |
Update Accounts
Update accounts | key: updateAccounts
Input | Key | Description | Example |
---|---|---|---|
Account Id | accountId | Provide the account Id for the user | 001 55 0 0000WO1Zi AAL |
Account Name | accountName | Provide the account name | Sample |
Phone | phoneNo | Mention the phone number of the user | +14842918692 |