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
- Login to your Salesforce account https://login.salesforce.com/ or create a developer account from here https://developer.salesforce.com/signup.
- Click on “Gear icon” > “Setup.”
- On the sidebar, under the section PLATFORM TOOLS, select “Apps > App Manager.”
- Click the “New External Client App” button on the top right of the webpage.
- The “External Client App Manager” form will appear.
- In the Basic Information panel, provide an External Client App name, a Contact email and Distribution State.
- Scroll down to API (Enable OAuth Settings) and enable the checkbox “Enable OAuth”.
- For the Callback URL field, enter the URL you use to access your 3CX admin 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)
- Scroll down to the Security section, Make sure that the "Require Secret for Web Server Flow" and "Require Secret for Refresh Token Flow" options are selected.
- In addition, note that PKCE (Proof Key for Code Exchange) is now supported on 3CX Version 20, Update 6. You can use the PKCE authentication flow by enabling the option "Require Proof Key for Code Exchange (PKCE) Extension for Supported Authorization Flows". If the option is disabled, the PKCE will be ignored and the authorization will be done successfully.
- Press Create.
- Click “Apps > External Client App Manager> Find your app” from the list and click “Edit Policies”.
- Under Policies, Go to the OAuth policies section and set Permitted users to “All users can self-authorize”.
- Click Save.
- Under Settings, Go to the OAuth Settings section and click on the button “Consumer Key and Secret”. Then copy the values for “Consumer Key” and “Consumer Secret” - we will need to add these later inside the 3CX CRM integration section.
Step 2: Configure 3CX
- In the 3CX Admin Console go to “Integrations” > “CRM”.
- Select “SalesforceV2” from the dropdown list.
- Fill in the details you got in the previous step for Consumer Key, and Consumer Secret, and press the “Save” button and then 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
- 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.
- 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.
- 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.
- 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.
- 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
- 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.
- 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.
- ⚠ Important: In 3CX Admin Console, go to “System” > “Phonebook” > “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.
- ⚠ 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
- 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.
- 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.
- 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.
- 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.
📄 Note: when creating contacts in Salesforce, the company name specified in the Web Client will be ignored. This is due to Salesforce API limitations. This only applies to contacts, the company name is set when creating leads.
See Also
- See how to integrate your CRM with the 3CX API.
- Learn how to set up Bitrix24 integration.
- Learn how to set up ConnectWise integration.
- Learn how to set up Microsoft 365 Integration.
- Learn how to set up Zendesk integration.
- Learn how to set up Zoho integration.
- Learn how to set up Microsoft SQL Server, MySQL and PostgreSQL database integrations.
Last Updated
This document was last updated 16 July 2025