# Salesforce

## Account Integration using Apps and OAuth

To begin, you will need:

* A Salesforce account.

**STEP 1:** In iMBrace, create a new credential of type **Salesforce OAuth2 API**. Copy the URL displayed under **OAuth Redirect URL**.

<figure><img src="https://lh6.googleusercontent.com/G60WeFjdiPkGrQcQDqULlPgtosBkHputujwe842invqR22BzmXRxBZ74DVMAW3DsKI0ycv7UD7CwwFQ0KYmmit_5h3HPsaTiYDGZwshdTUIyYaNE5vh6_I3UtCgVxzk1wUpC2dGTDv-4Ymxc6Fj4WvZDpvewPhr0Q5wHh7gKaKcHne4Ngivp2e9noXX9EA" alt=""><figcaption></figcaption></figure>

**STEP 2:** In Salesforce, click on the gear icon in the top-right corner and go to **\[Setup]** in the dropdown.

<figure><img src="https://lh6.googleusercontent.com/YBpRndzPVzbTclfhuGp961kvgNnIe5MVpnw9v-ynHpwEDZAU0czZiFh3f22RRy-wbnwjH7jpYJIP8pB3fgZsyDzdwqbPl-_gfv-Rn9qqGpJs1Kz6-PkarGsSqJpo3MD-06dsKXcPn_246XbE8zKsU7vu2SiV3DXHnvc70GH_xOvJ2RvfAuMBxr_7r0D_0Q" alt=""><figcaption></figcaption></figure>

**STEP 3:** In the left side-bar, go to **Platform Tools > \[Apps] > \[App Manager]**. To create a new app to be used with iMBrace, click on **\[New Connected App]** near the top-right corner.

<figure><img src="https://lh6.googleusercontent.com/rIJv9Il17WzH38r84EED-guEVbE6sSLpcpLGp_RnTaBkpIlk-AzXvkxPUdluwvNy59iIyRaLvQ7AZbqwfOXArCrXIfFhUBIO8W9MOU7q5BmDdMtXaswIlJPCBqG8u8O3gfI71UzLH_11VPIEF9GZHRW_IOVfUKH2HaU2XC2FKnlxlTZSuPprsl14lEBtPA" alt=""><figcaption></figcaption></figure>

**STEP 4:** Enter the relevant information into the fields as necessary, then enable the checkbox **\[Enable OAuth Settings]** near the bottom of the screen. Additional options will appear under the checkbox.

<figure><img src="https://lh4.googleusercontent.com/k8tvv6yZukP9-of5rohn_MJ0ekux-IsvoSf1bSvZ1fSx3CKqbbphTR_1I9IcAKzkj03ifCg2ChlAiD48TdbkaPrjqq6I5Z91tnJBDpZu6dLdTfjVssYRE5SvOOeFmTprKx2XlEaEcHXKKTQvQOM8Ch0BAIXuBM_rOJYEKiDS6hRHohlKyuR0YsxCUnsVhg" alt=""><figcaption></figcaption></figure>

**STEP 5:** Paste the redirect URL copied in step 1 into the **Callback URL** field. Under **Selected OAuth Scopes**, select the **Full Access** and **Perform requests at any time** scopes.

<figure><img src="https://lh6.googleusercontent.com/-sLLSe08oF8DiJiiJPWV2reNy0r_WuMCyK1V51vqneFogzTNATRCBW-zv-G7f0OGT7wIIONaZiaEDj3qfFgeLMbTBzp-5bNFWxqdUVr1wQDcC0puZba6SapfzugjScecqn-pF7m_DHqFWHnajGQDf-PdTUF9M0soiNr4T7uVCP7wIKqtpsmhtge1pLxtMA" alt=""><figcaption></figcaption></figure>

**STEP 6:** Save the app settings to create a new app. Resolve any errors and enter any missing information as necessary.

**STEP 7:** The newly-created app should appear in the list of apps under **App Manager**. Click on the down-arrow on the right for your app, then click **\[View]** in the dropdown that appears.

{% hint style="warning" %}
At the time of this document, Salesforce has a bug and this down arrow is not clickable unless you first click on the space or the check mark next to it on the left.
{% endhint %}

<figure><img src="https://lh6.googleusercontent.com/3CwOKIwbiyDWH6eeuH6eevbNHhYE5vfJpdOj5Im1QK_uGRA_OWVj-Vj7dTv-lD95La-gn3S1R-SEST0t9QDJ5Ieaz8Qe3dwj9Zai4S_MxwA2U5E2mb6rxW_Y_eupV20bvXArS5b0HQ-nI7cpeueuHblZb5hEsqjP1Py1aEvKqoCcqieI8qRrHU97NluL4A" alt=""><figcaption></figcaption></figure>

**STEP 8:** Under the **API (Enable OAuth Settings)** section, go to **\[Manage Consumer Details]**.

{% hint style="info" %}
You may be prompted by Salesforce to perform email verification before continuing.
{% endhint %}

<figure><img src="https://lh4.googleusercontent.com/-A2l1kgPzxYlwW5-G3Q4XgDoqntdDXlGsxyNYZdRb1ilBDYSuT0OHKYHtyBwX6DH_jaGEtVr2HJBV43qT6mkNkveqSh95lZAwyNGkLWpkf0LYMr92pNT28x3EmNw4Wi4aBgiiY847deKya3besOMAZ6_v6CeA_dFWAxNhuUVP_U_3O5X-fP7GZRJiII3mg" alt=""><figcaption></figcaption></figure>

**STEP 9:** Identify the **consumer key** and **consumer secret**. Copy and paste them into iMBrace under the **client ID** and **client secret** fields respectively.

<figure><img src="https://lh4.googleusercontent.com/jy5As56Bypyyd0nzrg3fwLTyG1F1pEZOaLV-B7od67CGaCdnYyZBYDgYal8NZhB3iXZ-il0mZXnC2Cu4eoeu3GkV_kybIyhdfM_bI8oMztBNCKUnj1kJxFxStEgKQDnEBjRpQPhdkoSKGIlrCkj-OkpmmYENXUsdNYyn4WWTGVRBDjtM4Ec7M3QORcs9BQ" alt=""><figcaption></figcaption></figure>

<figure><img src="https://lh6.googleusercontent.com/G60WeFjdiPkGrQcQDqULlPgtosBkHputujwe842invqR22BzmXRxBZ74DVMAW3DsKI0ycv7UD7CwwFQ0KYmmit_5h3HPsaTiYDGZwshdTUIyYaNE5vh6_I3UtCgVxzk1wUpC2dGTDv-4Ymxc6Fj4WvZDpvewPhr0Q5wHh7gKaKcHne4Ngivp2e9noXX9EA" alt=""><figcaption></figcaption></figure>

**STEP 10:** Select the correct **environment type**, and click **\[Connect]**.

<figure><img src="https://lh3.googleusercontent.com/gwmYuPvpY6ftef4EzVIPuiqoIMyFDr68-W8lIGnVoz8h1qTYhgl50qWna8KhtEF4y__B6UA7PdgFrNI04V8qyi0DwSQXNkb2Pyss_WEg-oF80EV42l3EPRiMmEVI65sJJu6iYdpsrkJG2XU_GsdS_f5XtQKzdVWiKmGDypEaiXfLExI45sdP06BP1sVXrw" alt=""><figcaption></figcaption></figure>

**DONE:** The credential can then be used for Salesforce nodes.
