Config API Version 2 Caller Insight for Salesforce
Introduction
The Infinity Caller Insight app can be integrated with Salesforce to give your call center agents full access to call information without leaving the Salesforce interface.
Using this integration, agents can rate incoming calls within Salesforce, log call information against existing leads and contacts, or create new leads for first time callers. Call activity history created by this integration will automatically get related marketing information.
Once installed, our Caller Insight app for Salesforce will automatically show post call rating options in the Salesforce interface. With a few extra settings you’ll be able to create new leads and even populate custom fields with Infinity data.
Salesforce Button Config
Key to logging calls or creating new leads are the configurable buttons in the Caller Insight for Salesforce app.
Button Properties
Each custom button has the following properties:
- sfButtonId (int) - Uniquely identifies the action button. Ratings that have not been overridden from the default “Rate Call” action will not have a corresponding button ID.
- sfOrgRef (string) - The Salesforce organisation that this button will be used in. Each IGRP may be linked to only one Salesforce organisation. This is normally your production organisation.
- callRating (string) - The Call Rating option that this button applies to. This is unique per IGRP/Salesforce organisation as each rating option may only be linked to one action.
- buttonAction (string) - Identifies the type of button and the action behind it. Possible values are rateCall, logCall or createLead.
- buttonLabel (string) - This is the text that will appear on the action button when the associated rating is selected.
- isDefaultButton (int) - For logCall buttons, this indicates the rating and action to choose by default when linking a call to an existing Salesforce lead or contact record.
- actionParams (array) - Any custom parameters to send with the button’s action, e.g. default field values for creating new records. See Action Parameters.
Button Actions
Each of your Call Rating options can be configured with a different action. By default all Call Rating options start with an action of “Rate Call” and can be changed using the routes listed here.
Rate Call
This is the default action for all Call Rating options. It will rate the call and allows you to associate the call to a Salesforce record. You might choose to override the default Rate Call action with a customised version e.g. if you want to populate a custom activity field.
If configured, any Action Parameters will be applied to the call activity record.
Log Call
This will rate the call and requires you to associate the call to a Salesforce lead or contact record. If person accounts are enabled in your Salesforce organisation, these will be treated as contacts for this purpose.
The “Log Call” action button may be configured as the default action when linking a call to an existing Salesforce lead or contact record. If an existing record is selected as matching the inbound caller, the Caller Insight app will switch to the logCall action button that has isDefaultButton set to 1.
If configured, any Action Parameters will be applied to the call activity record.
Create Lead
This action creates a new lead record, then rates the call and associates it to the new lead.
If configured, any Action Parameters will be applied to the lead record.
Action Parameters
Each button’s action may be modified with a number of parameters. This usually means adding a default values for call activity or lead records when they are created.
Action parameters are defined as a list of objects, keyed numerically with series of key/value pairs in each object. This allows for different field names to be provided for different Salesforce Object types.
The parameter key is the API name of the Salesforce field that should be populated when a new record is created, and the parameter value defines what to insert into that field. Both standard and custom fields may be populated in this way.
Fixed Parameters
If the parameter value is a fixed string, then the field will be populated with that exact value. e.g. if you want to assign all new lead records to a Salesforce queue by default, specify the queue ID in the actionParams for createLead:
...&buttonAction=createLead
&actionParams[0][sfFields][Lead]=Owner
&actionParams[0][value]=00G200000001ABC
You can specify any lead field for the “Create Lead” action, or any activity field for “Rate Call” or “Log Call” actions. This includes custom as well as standard object fields, e.g. if you had a custom field to show the origin of call records, you could set it with a fixed default value:
...&buttonAction=logCall
&actionParams[0][sfFields][Lead]=Origin__c
&actionParams[0][value]=Infinity
Dynamic Parameters
As well as setting fixed default values for any field, you may prompt the user to choose a value from a dropdown list within the Caller Insight app. This works for Salesforce picklist data types, and for record types. You will need to define the list of picklist options, and for record types you must define the record type IDs and labels. Dropdown action parameters require a more complex config, including the field label and a list of options.
e.g. to populate the country code picklist from the Caller Insight app when creating a new lead, you could define the following:
...&buttonAction=createLead
&actionParams[0][sfFields][Lead]=CountryCode
&actionParams[0][type]=dropdown
&actionParams[0][label]=Country
&actionParams[0][options][0][label]=Canada
&actionParams[0][options][0][value]=CA
&actionParams[0][options][0][label]=United%20States
&actionParams[0][options][0][value]=US
where e.g. “CA” is one of the picklist values, and “Canada” is the corresponding label.
Or to require that a record type is chosen when creating a new lead, you would define the dropdown something like this:
...&buttonAction=createLead
&actionParams[0][sfFields][Lead]=RecordTypeId
&actionParams[0][type]=dropdown
&actionParams[0][label]=Record%20Type
&actionParams[0][required]=1
&actionParams[0][options][label]=Direct
&actionParams[0][options][value]=012b0000000kGkl
&actionParams[0][options][label]=Reseller
&actionParams[0][options][value]=012i0000000trmR
where e.g. “012b0000000kGkl” is a lead record type ID, and “Direct” is the record type name.
List Salesforce buttons
Lists buttons for an IGRP linked to a Salesforce org.
Request:
GET /config/v2/igrps/{IGRP SPECIFIER}/callerInsight/sfButtons
URL Path Params
- IGRP SPECIFIER (int) - Installation ID. only PBX IGRP’s linked to a Salesforce Org can retrieve the Buttons.
- filter (array) OPTIONAL - One or more filters, see Filter Types.
- sort (array) OPTIONAL - One or more sorting params, see Sort Types.
Filter Types
- sfButtonId (int) - Button ID.
- buttonAction (string) - Identifies the type of button and the action behind it. Possible values are prompt, logCall, createLead, rateCall.
- buttonLabel (string) - Button Label.
- callRating (string) - The text of the default call rating for this button.
- isDefaultButton (int) - A flag indicating that this the the default button where duplicate actions exist.
Sort Types
- sfButtonId (int) - SF Button ID.
- buttonAction (string) - Identifies the type of button and the action behind it. Possible values are prompt, logCall, createLead, rateCall.
- buttonLabel (string) - Button Label.
- callRating (string) - The text of the default call rating for this button.
- isDefaultButton (int) - A flag indicating that this the the default button where duplicate actions exist.
Response:
Returns a list of Salesforce buttons configured for the IGRP.
- sfButtonId (int) - SF Button ID.
- sfOrgRef (string) - The Salesforce organisation that this button will be used in.
- buttonAction (string) - Identifies the type of button and the action behind it. Possible values are prompt, logCall, createLead, rateCall.
- buttonLabel (string) - Button Label.
- callRating (string) - The text of the default call rating for this button.
- isDefaultButton (int) - A flag indicating that this the the default button where duplicate actions exist.
- actionParams (array) - Any custom parameters to send with the button’s action, e.g. default field values for creating new records. See Action Params.
{"sfButtonId":"1","sfOrgRef":"00Di0000000jTQiMAM","buttonAction":"prompt","buttonLabel":"Please select","callRating":"Prompt Test"}
{"sfButtonId":"2","sfOrgRef":"00Di0000000jTQiMAM","buttonAction":"createLead","buttonLabel":"Create Lead","callRating":"New Lead"}
{"sfButtonId":"3","sfOrgRef":"00Di0000000jTQiMAM","buttonAction":"rateCall","buttonLabel":"Rate Call","callRating":"Rate Call","actionParams":{"Call_Source__c":"Infinity"}}
{"sfButtonId":"4","sfOrgRef":"00Di0000000jTQiMAM","buttonAction":"logCall","buttonLabel":"Log Call","callRating":"Log Call"}
Read a Salesforce button
Request:
GET /config/v2/igrps/{IGRP SPECIFIER}/callerInsight/sfButtons/{SF BUTTON SPECIFIER}
URL Path Params
- IGRP SPECIFIER (int) - Installation ID. only PBX IGRP’s linked to a Salesforce Org can retrieve SF Buttons.
- SF BUTTON SPECIFIER (int) - Sales Force Button ID.
Response:
Returns a Salesforce button configured for the IGRP.
- sfButtonId (int) - SF Button ID.
- sfOrgRef (string) - The Salesforce organisation that this button will be used in.
- buttonAction (string) - Identifies the type of button and the action behind it. Possible values are prompt, logCall, createLead, rateCall.
- buttonLabel (string) - Button Label.
- callRating (string) - The text of the default call rating for this button.
- isDefaultButton (int) - A flag indicating that this the the default button where duplicate actions exist.
- actionParams (array) - Any custom parameters to send with the button’s action, e.g. default field values for creating new records. See Action Params.
{"sfButtonId":"1","sfOrgRef":"00Di0000000jTQiMAM","buttonAction":"prompt","buttonLabel":"Please select","callRating":"Prompt Test","callNotesField":"","srcPhoneNumberField":""}
Create a Salesforce button
Request:
POST /config/v2/igrps/{IGRP SPECIFIER}/callerInsight/sfButtons
URL Path Params
- IGRP SPECIFIER (int) - Installation ID. only PBX IGRP’s linked to a Salesforce Org are allowed to access the buttons.
Post Params
- callRating (string) - The text of the default call rating for this button.
- buttonAction (string) - Identifies the type of button and the action behind it. Possible values are prompt, logCall, createLead, rateCall.
- buttonLabel (string) - Text label for the button.
- actionParams (array) - Any custom parameters to send with the button’s action, e.g. default field values for creating new records. See Action Params.
- isDefaultButton (int) OPTIONAL - A flag indicating that this the the default button where duplicate actions exist.
Response:
Returns the ID of the newly created button.
HTTP 201 - CREATED
{"sfButtonId":"4"}
Update a Salesforce button
Request:
POST /config/v2/igrps/{IGRP SPECIFIER}/callerInsight/sfButtons/{SF BUTTON SPECIFIER}
URL Path Params
- IGRP SPECIFIER (int) - Installation ID. only PBX IGRP’s linked to a Salesforce Org can retrieve SF Buttons.
- SF BUTTON SPECIFIER (int) - Sales Force Button ID.
Post Params
- callRating (string) OPTIONAL - The text of the default call rating for this button.
- buttonLabel (string) OPTIONAL - Text label for the button.
- actionParams (array) - Any custom parameters to send with the button’s action, e.g. default field values for creating new records. See Action Params.
- isDefaultButton (int) OPTIONAL - A flag indicating that this the the default button where duplicate actions exist.
Response:
HTTP 204 - NO CONTENT
Delete a Salesforce button
Request:
DELETE /config/v2/igrps/{IGRP SPECIFIER}/callerInsight/sfButtons/{SF BUTTON SPECIFIER}
URL Path Params
- IGRP SPECIFIER (int) - Installation ID. only PBX IGRP’s linked to a Salesforce Org can retrieve SF Buttons.
- SF BUTTON SPECIFIER (int) - Sales Force Button ID.
Response:
HTTP 204 - NO CONTENT
List call ratings
Lists call ratings for all IGRPs under a Salesforce Org.
Request:
GET /config/v2/igrps/{IGRP SPECIFIER}/callerInsight/sfButtons/callRatings
URL Path Params
- IGRP SPECIFIER (int) - Installation ID.
- filter (array) OPTIONAL - One or more filters, see Filter Types.
- sort (array) OPTIONAL - One or more sorting params, see Sort Types.
Filter Types
- callRatingItemId (int) - Call rating ID.
- itemText (string) - The text of the default call rating for this button.
- isUsed (int) - A flag indicating if the call rating is currently assigned to a button.
Sort Types
- callRatingItemId (int) - Call rating ID.
- itemText (string) - The text of the default call rating for this button.
- isUsed (int) - A flag indicating if the call rating is currently assigned to a button.
Response:
Returns a list of Salesforce buttons configured for the IGRP.
- callRatingItemId (int) - Call rating ID.
- itemText (string) - The text of the default call rating for this button.
- isUsed (int) - A flag indicating if the call rating is currently assigned to a button.
{"callRatingItemId":"1","callRating":"Prompt Test","isUsed":"1"}
{"callRatingItemId":"2","callRating":"New Lead","isUsed":"1"}