Follow

Using The External Recording Link API (Beta) With Salesforce

Chronicall customers may want to send recording links to Salesforce after a call has been ended. This article will demonstrate one way to configure the Chronicall API to send the External Recording Link to a custom object in Salesforce after an outbound call to a Salesforce contact. All agents making the outbound calls must have Chronicall Dashboard licenses for this integration to work.

There are four general steps in completing this configuration.

1) Create a custom object 

2) Create a Flow to Add the External Link to a custom object associated with the contact.

3) Create a Visual Force Page to Receive Data From Chronicall and Launch the Flow

4) Configuring the Chronicall API to Send the Data

 

Create a Custom "Recordings" Object

Create a custom object called "Recordings". Add the following custom fields to the object:

Custom Field  Field Type 
CallId Text Field
Agent Text Field
Call Direction Text Field
Recording Link URL Field
Call Group Text Field
Call Time Text Field
Call Tag Text Field
Contact Look Up field / Contact

 

Create a Flow to Add the External Link to the Correct Record

Open the flow designer and create the following variables:

Variable Name  Variable Type  Input / Output Type
callid Variable - Text Input And Output
agent Variable - Text Input And Output
callDirection Variable - Text Input And Output
externalNumber Variable - Text Input And Output
externallistenlink Variable - Text Input And Output
callgroup Variable - Text Input And Output
calltime Variable - Text Input And Output
calltag Variable - Text Input And Output
varfoundcontactid Variable - Text Private 
FormattedExternalNumber Formula Text

Paste the following formula to FormattedExternalNumber formula. This reformats the number that Chronicall sends ie. 918017132800 to the optimal format to search phone. numbers in Salesforce ie. (801)713-2800.

'('&MID(RIGHT(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE({!externalNumber},"("," "),")","")," ",""),"-",""),"."," "),10) ,1, 3)&') '& MID(RIGHT(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE({!externalNumber},"("," "),")","")," ",""),"-",""),"."," "),10) ,4,3)&'-'&MID(RIGHT(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE({!externalNumber},"("," "),")","")," ",""),"-",""),"."," "),10),7,4)

 

Add a Record Lookup element, set it as the starting element, and configure it as shown:

 

Add a Record Create element and configure it as follows:

Save the flow as "Chronicall Recording Link API" and make sure that it is an autolaunched flow. This flow will take the external number from Chronicall and find the contact associated with that phone number. A new recording will be created on the Recordings Object and it will contain a link to the recorded call.

 

Create a Visual Force Page to Receive Data From Chronicall

Here is a visual force page and controller used to launch the flow we created and sets the parameters of the flow. The URL of this page will be required in the configuration of the Chronicall API. If the agents being recorded are logged in Salesforce users they will need access to this page through user permissions. If the agent is not a logged in Salesforce user you may need to place this on a public facing force.com site and enable all the necessary permissions.

<apex:page controller="ChronicallRecordingAPI" action="{!init}" showHeader="false" standardStylesheets="false">

    <flow:interview name="Chronicall_Recording_Link_API">
         <apex:param name="externallistenlink" value="{!externallistenlink}"/>
         <apex:param name="callid" value="{!callid}"/>
         <apex:param name="agent" value="{!agent}"/>
         <apex:param name="callDirection" value="{!callDirection}"/>
         <apex:param name="externalNumber" value="{!externalNumber}"/>
         <apex:param name="callgroup" value="{!callgroup}"/>
         <apex:param name="calltime" value="{!calltime}"/>
         <apex:param name="calltag" value="{!calltag}"/>
     </flow:interview>
</apex:page>


public class ChronicallRecordingAPI {

    public string externallistenlink {get; set;}
    public string callid{get; set;}
    public string agent{get; set;}
    public string callDirection{get; set;}
    public string externalNumber{get; set;}
    public string callgroup{get; set;}
    public string calltime{get; set;}
    public string calltag{get; set;}

    public PageReference init() {
    if ( ApexPages.currentPage().getParameters().get('externallistenlink') != null )
         externallistenlink = ApexPages.currentPage().getParameters().get('externallistenlink');
         
    if ( ApexPages.currentPage().getParameters().get('callid') != null )
         callid = ApexPages.currentPage().getParameters().get('callid');

    if ( ApexPages.currentPage().getParameters().get('agent') != null )
         agent = ApexPages.currentPage().getParameters().get('agent');
     
    if ( ApexPages.currentPage().getParameters().get('callDirection') != null )
         callDirection = ApexPages.currentPage().getParameters().get('callDirection');
         
    if ( ApexPages.currentPage().getParameters().get('externalNumber') != null )
         externalNumber = ApexPages.currentPage().getParameters().get('externalNumber');         

    if ( ApexPages.currentPage().getParameters().get('group') != null )
         callgroup = ApexPages.currentPage().getParameters().get('group');                                     

    if ( ApexPages.currentPage().getParameters().get('time') != null )
         calltime = ApexPages.currentPage().getParameters().get('time');

    if ( ApexPages.currentPage().getParameters().get('tag') != null )
         calltag = ApexPages.currentPage().getParameters().get('tag');
         
        return null;
    }
}

 

Make the Page Accessible

Now that your visual force page is created, it needs to be placed on a force.com site. You will also need to give your guest user permission to read and write to your newly created Recordings object as well as the newly created visual force page.

 

Configuring the Chronicall API

Navigate to Admin > System Settings > Dashboard Settings > Dashboard API's

Click on the "onDrop" tab and then click "Add"

Enter the URL of the visual force page and select the users for whom the API should trigger for.

 

 
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request
Powered by Zendesk