Salesforce CRM Integration

Introduction

3CX provides integration with Salesforce via the 3CX API for CRM with the following features:

  • Caller ID to Contact Name – inbound calls trigger a Salesforce contact lookup.
  • Contact Lookup in Salesforce based on Name, Number or Email if you search for a name in the 3CX Webclient
  • Call & Chat Journalling – calls and chats are logged in the Salesforce Contact Card as CRM call records.
  • Create a new Salesforce contact from the 3CX client for calls from new numbers.
  • Click to Call – launch calls straight from Salesforce via 3CX, using the 3CX Click2Call Browser extensions for Google Chrome and Microsoft Edge.

Requirements:

  • Your Salesforce account must have REST API Enabled. Check here to see the Salesforce editions in which the API is available.
  • Salesforce accounts with Person Accounts enabled are not supported.

Step 1: Configure Salesforce

  1. Login to your Salesforce account https://login.salesforce.com/ or create a developer account from here https://developer.salesforce.com/signup.
  2. Click on “Gear icon” >  “Setup.”
  3. On the sidebar, under the section PLATFORM TOOLS, select “Apps > App Manager.”
  4. Click the “New Connected App” button on the top right of the webpage.
  5. Enter an App name, example 3CXPBX, a contact email and press save.

  1. Scroll down to API (Enable OAuth Settings) and enable the checkbox “Enable OAuth Settings”.
  2. For the Callback URL field, enter the URL you use to access your 3CX management console, adding “/api/oauth2crm” at the end, e.g.: https://my-pbx.example.com/api/oauth2crm. Then give permissions as per image above. The permissions are:
  • Access the identity URL service (id, profile, email, address, phone)
  • Access unique user identifiers (openid)
  • Full Access (full)
  • Manage user data via APIs (api)
  • Manage user data via Web browsers (web)
  • Perform requests at any time (refresh_token, offline_access)
  1. Press Save.

  1. Click “Apps > App manager > Find your app” from the list and click “View”.
  2. In the "API (Enable OAuth Settings)” section, click on the button “Manage consumer details”. Then copy the values for “Consumer Key” and “Consumer Secret” - we will need to add these later inside the 3CX CRM integration section.
  3. Click on “Manage” at the top and “Edit Policies.”

  1. Go to the OAuth policies section and set Permitted users to “All users may self-authorize”. Press Save.

Step 2: Configure 3CX

  1. Login to the 3CX Management Console  and go to “Settings” > “CRM Integration” > “Server Side” tab.
  2. Select “SalesforceV2” from the dropdown list.
  3. Fill in the details you got in the previous step for Consumer Key, and Consumer Secret, and press the Authorize button to start the authorization process. Grant access to 3CX, and the Refresh Token will be shown under the Authorize button.

Step 3: Configure Call & Chat Journaling

  1. To report external calls and chats to Salesforce, the email address configured for the 3CX extension must match the email address of a Salesforce user. This way 3CX can map the 3CX extension receiving the call or chat to the Salesforce user.
  2. Check the “Enable Call Journaling” option to report external calls to the CRM, and configure these “Call Journaling” parameters:
  • “Call Subject” - the call’s subject.
  • “Answered Inbound Call” - description for answered inbound calls.
  • “Missed Call” - description for missed calls.
  • “Answered Outbound Call” - description for answered outbound calls.
  • “Unanswered Outbound Call” - description for unanswered outbound calls.
  1. Please note that you can use variables in the “Call Journaling” parameters, denoted as
    [variable_name]
    , e.g. the external number is specified as
    [Number]
    . The available variables to use are listed
    here.

  1. If you want to report chats to the CRM, check the Enable Chat Journaling checkbox and configure the parameters below:
  • Chat Subject: The subject of the chat session.
  1. Please note that you can use variables in the “Chat Journaling” parameters, denoted as
    [variable_name]
    , e.g. the external number is specified as
    [Number]
    . The available variables to use are listed
    here.

Step 4: Configure e164 contacts and caller ID

  1. To get a match with Salesforce, the last 7 digits of the incoming Caller ID must match with the last 7 digits of a phone field in a CRM entry, or the full number received from the SIP Trunk must fully match the phone number in the CRM.
  2. Salesforce can store the numbers in E164 format, so if your SIP Trunk provides the caller’s number in E164 format as well, an exact match is preferred. You can also use Caller ID Reformatting to adjust the caller’s number before being passed on to the CRM.
  3. ⚠ Important: In 3CX Management Console, open “Advanced” > “Contacts” > “Options”. Set the matching strategy to "Match exactly" when possible (E164 format required in Salesforce and the SIP Trunk), or “Match at least X number of characters” and set the value to 7.
  4. ⚠ Important: In Salesforce ensure that all your contacts’ numbers are stored in E164 format, including the plus (+) prefix. This plus (+) prefix prevents Salesforce from automatically reformatting the number if you’re located in the USA or Canada, causing that the contact lookup fails.

Step 5: Configure Contact Creation

  1. If you want to create new contacts in the CRM when a call is received from an unknown number (not found in both 3CX and CRM), check the “Allow contact creation directly to your CRM using 3CX Web Client” checkbox and configure the parameters below.
  2. Contact Creation parameters are:
  • Create Lead or Contact - The entity to be created (Lead/Contact).
  • New Lead Company - The name of the Company when a Lead is created.
  1. Please note that you can use variables in the parameters. Variables are specified between [], for example the external number is specified as [Number]. The available variables to use are listed here.
  2. When the caller’s number can’t be matched to a contact, the 3CX client will let the user create the contact by filling the details in a dialog.

See Also

Last Updated

This document was last updated on 23 September  2023

https://www.3cx.com/docs/salesforce-crm-integration/ 

Discuss this article