Configure smart-routing to contact owner on a shared phone number to ensure callers are efficiently connected to their point of contact
In this guide you will learn
- How does using the Ring-to (via API) widget to configure smart routing enhance efficiency and customer experience?
- How to set up your smart routing to the Salesforce Contact Owner
- Step One: Setting up the OAuth Connected App within Salesforce
- Step Two: Setting up the Ring-to (via API) widget within Aircall Smartflows
⚠️ The Ring-to (via API) widget needs to be enabled via a feature request. Please reach out to your Aircall point of contact for this to be enabled before getting started.
How does using the Ring-to (via API) widget to configure smart routing enhance efficiency and customer experience?
Smart routing on a shared phone number offers a multitude of benefits, mainly enhancing efficiency, accuracy and customer experience. By intelligently directing incoming calls based on criteria from your CRM, smart routing ensures that each caller is swiftly connected to the most appropriate agent, reducing wait times and improving first-call resolution rates.
Using Aircall’s Ring-to (via API) widget in Smartflows, a popular implementation is the routing of inbound callers to the Salesforce Contact Owner. This eliminates the whole team being interrupted by inbound calls from customers that are not theirs, and removes the possibility of the caller having to be placed on hold while being transferred to their dedicated point of contact.
How to Set Up Your Smart Routing to the Salesforce Contact Owner
Step One: Setting up the OAuth Connected App within Salesforce
⚠️ This section requires familiarity with Salesforce App Manager and Salesforce Connected Apps
An OAuth Connected App in Salesforce needs to to first be created in order to gain access to Salesforce’s REST API.
In your Salesforce Environment, navigate to Setup → App Manager (in the Quick Find box). Click on New Connected App in the top-righthand corner.
Provide a name for your new OAuth Connected App, as well as a contact email address. Once you have done that, complete the API (Enabled OAuth Settings) section as follows:
-
Enable OAuth Settings =
Enabled
-
Callback URL =
https://login.salesforce.com/services/oauth2/success
- 💡A callback URL is the URL that is invoked after OAuth authorisation for the consumer (connected app)
- 💡 In some contexts, the URL must be a real URL that your web browser is redirected to. In others, the URL isn’t actually used. The latter is the case in this instance. You are able to use any URL you wish to, including the example provided above
-
Selected OAuth Scopes =
Manager user data via APIs (api)
- 💡Allows access to the current, logged-in user’s account using APIs, such as REST API and Bulk API 2.0
- 💡 It will be used in conjunction with the “Enable Client Credentials Flow” to run every Salesforce API Request using a specific Salesforce User (a Salesforce Admin).
-
Enable Client Credentials Flows =
Enabled
Ensure you click Save.
Upon completion of this, you may be prompted with a message warning that the OAuth credentials (consumer key & secret) could be used to access the org. Simply click OK. Click on Manage Consumer Details to get access to the consumer key, also known as Client ID
and consumer secret, also known as Client Secret
.
⚠️ Ensure you copy the values of both to somewhere safe and secure
Returning to the Manage Connected Apps page, in the Quick Find box on the left-side of the screen, search for ‘Connected’ and select Manage Connected Apps. Find your configured OAuth app, open it and select Edit Polices
At the bottom under Client Credentials Flow, click on the magnifying glass icon beside the Run As field. Select the profile of an existing Salesforce Admin. This specific user will be used to run every Salesforce API request.
Once these steps have been completed, this concludes the Salesforce set up aspect and we now head into the Aircall Dashboard.
Step 2: Setting Up the Ring-to (via API) Widget within Aircall Smartflows
⚠️ This section requires familiarity with Salesforce REST API, JSON and Smartflows
Now in the Aircall Dashboard, we have to configure the Smartflows number.
It is important to note, that the Aircall users who will have calls routed to them via the API do not need to be assigned to the Smartflows Call Distribution. If they are assigned, the user will receive any missed call notifications in their To-Do list if they miss the transferred call. However, they will not receive these notifications if they are not assigned to the number.
With that in mind, navigate to the phone number you wish to configure the Ring-to (via API) widget on. Add your Ring-to (via API) widget to your desired spot in your Smartflows distribution which will open up the widget editor.
To begin, set the Authentication Method as OAuth
and then click on Set Credentials. This will open the credentials pop up form, which is to be completed as follows:
-
Login URL =
https://MyDomainName.my.salesforce.com/services/oauth2/token
(enter your Salesforce domain name in the bolded section of the URL) -
Client ID = the '
Consumer Key
' that you retrieved from your Salesforce OAuth Connected App previously. -
Client Secret = the ‘
Consumer Secret
' that you retrieved from your Salesforce OAuth Connected App previously.
To finish the request configuration, we must populate the two remaining fields with the below information:
-
Method =
GET
-
URL =
https://MyDomainName.my.salesforce.com/services/data/v51.0/parameterizedSearch/?q={{callerNumber}}&sobject=Contact&Contact.fields=id,name,Contact.Owner.Email&Contact.limit=10&Contact.orderBy=LastModifiedDate+DESC
(enter your Salesforce domain name in the bolded section of the URL)
Using this API endpoint URL will effectively search for the inbound caller’s number (in International E.164 format) in all your Salesforce Contacts. If it finds at least one, it will return the last updated Contact (with a matching phone number) and include the Contact ID, Contact Name, and Contact Owner’s Email Address in the returned JSON payload.
Now that we have finished the request configuration, we complete our setup by setting the response configuration as follows:
-
Response type =
User (ID or email)
-
Path =
searchRecords[0].Owner.Email
To conclude, you must run a test on the response in the dedicated test field. Enter a valid phone number in the international E.164 format, and make sure there is a returned JSON payload and the Path (to find the value that will be used to transfer/route the inbound call) is valid.
💡 Adjust the ringing settings directly beneath the test to suit your business operations
You should now be ready to start testing some inbound calls for Smart-Routing to Salesforce Contact Owner using the Ring-to (via API) Widget!
Food for Thought
- Adding a team beneath the Ring-to (via API) widget can be a helpful addition to your flow. This works purely as a catchment for situations when the Contact Owner is not available, to ensure no calls are missed.
- You can set this configuration up with other Salesforce Objects such as the Account owner or the Lead owner
- Remember Aircall can only route inbound calls using the Ring-to (via API) Widget with simple logic (i.e. no branching based on conditions, no looping, etc.) – in other words, there must exist either…
- Under the profile of the Salesforce Object (i.e. Contact, Lead, etc.)
- Under an indirectly-accessible related Salesforce Object (e.g. User) to the main Salesforce Object (i.e. Contact, Lead, etc.)
- The values you are routing to must exist before configuring the Ring-to API widget.
Professional Services
If you need an extra hand with implementing this smart routing configuration, or would like to learn about similar automations to enhance your operations, check out our Professional Services page to book time with our Technical Consultants.