You are on page 1of 7

Pervasive Software

Integration Design
Specification
Twilio and Salesforce Integration

2 Integration Design Specification
Table of Contents
1. Introduction .............................................................................................................................................. 3
1.1 Purpose ............................................................................................................................................... 3
1.2 Project Scope ...................................................................................................................................... 3
1.2.1 Call or SMS to Activity .................................................................................................................. 3
2. Call or SMS to Activity ............................................................................................................................... 4
2.1 Call or SMS to Activity Workflow .................................................................................................... 4
2.2 Call or SMS to Activity Object Fields ............................................................................................... 5
2.3 Un-Mapped Leads to Leads Fields .................................................................................................. 5
2.4 Salesforce Activity Example ............................................................................................................ 5
2.5 Salesforce Activity Screenshot ........................................................................................................ 6
3. Call or SMS to Lead ................................................................................................................................... 7
3.1 Call or SMS to Lead ......................................................................................................................... 7
3.2 Salesforce Lead Screenshot ............................................................................................................ 7



3 Integration Design Specification
1. Introduction

1.1 Purpose
The purpose of this document is to describe the functional and technical implementation details of the
solution being developed for the Twilio to Salesforce Integration. This document will serve as the guide
during solution development.
Object Work flow
Object Fields

1.2 Project Scope
The scope of this integration for the unidirectional build is to move Calls or SMS Message information
from Twilio into Salesforce Activities.
1.2.1 Call or SMS to Activity
This is a unidirectional integration where Calls or SMS Messages, in Twilio, will be added to a
found Contact or Account as an Activity within Salesforce. In cases when a Contact or Account is
not found a Lead will be created (optional). In addition Salesforce Activities will be related to
Salesforce Campaigns if the Campaign includes the same number used to/from Twilio Users as
part of the Campaign Name.












4 Integration Design Specification
2. Call or SMS to Activity
2.1 Call or SMS to Activity Workflow

Start
Extract Calls and
SMS Messages from
Twilio a
Read Each XML SMS
or Call
(Occurrence Read)
Any More SMS
or Calls
Stop No
Extract
to = companyphone
from= contactphone
Find Salesforce Contact or
Account ID where
phone= contactphone
Found Contact
or Account
Yes
Lead option set
to True
No
Did user select Create lead
when Contact or Account not
found
Create Lead
Yes
No
Assigned To = Saleperson ID
Related To = Campign ID
Contact/Account/Lead = Contact ID
Create Activity into
Contact, Account or
Lead
Completed
Twilio Call or SMS
Message to Activity in
SalesForce
https://api.twilio.com/2010-04-01/Accounts/
{auth}/Calls.xml?StartTime=2011-11-16
https://api.twilio.com/2010-04-01/Accounts/
{auth}/SMS/Messages/?DateSent=2011-11-16
Get parameters
from DataCloud
Account SID
Auth Token
LastRun DateTime
Is SMS or Call
outbound
Yes
Is the SMS or Call
DateTime > LastRun
DateTime
Yes
No
Extract
to = contactphone
from = companyphone
Yes
SMS or Call is
inbound
No
Find SalesPerson ID
and Campaign ID
where Name
includes
companyphone

Parameters are stored by account in our DataCloud Platform and are accessible by the integration at run time.
These parameters will include Twilio Account SID, Twilio Auth Token, Integration Last Run DateTime, Salesforce
Username and Salesforce password (should include Salesforce security token).

Duplicates will not occur since all events with a DateTime earlier than our Integration Last Run DateTime will not
be processed.




5 Integration Design Specification
2.2 Call or SMS to Activity Object Fields

Twilio Call Fields Salesforce Activity Fields
Call or SMS(based on request) Subject
StartTime Due Date
Direction & To or From (Lookup Salesforce User ID
based on inbound or outbound)
Assigned To
To or From(Lookup Salesforce Campaign based on
inbound or outbound)
Related To
Direction & To or From & Duration & Status &
Recordings
Comments

2.3 Un-Mapped Call or SMS to Activity Fields

Twilio Salesforce
Sid Status = Set by user during setup
ParentcallSid Priority = Set by user during setup
DateCreated Set Notification Email
DateUpdated
AccountSid
PhoneNumberSid
EndTime
Price
AnsweredBy
ForwardedFrom
CallerName
2.4 Salesforce Activity Example
a. Incoming Call Comments
Inbound Call from: 5126985046
Duration: 6 min
Status: Completed
Recording 1: url
Recording 2: url
b. Outgoing Call Comments
Outbound Call to: 5126985046
Duration: 1 min
Status: No answer
Recording 1: url
c. Incoming SMS Comments
Inbound SMS: 5126985046

This is the body of the incoming text
d. Outgoing SMS Comments
Outbound SMS: 5126985046

This is the body of the outgoing text

6 Integration Design Specification
2.5 Salesforce Activity Screenshot

Inbound Call

Inbound Text
















7 Integration Design Specification
3. Call or SMS to Lead

3.1 Call or SMS to Lead

Twilio Call Fields Salesforce Activity Fields
CallerName Last Name
CallerName Company
To or From Phone
To or From(Lookup Salesforce Campaign based on
inbound or outbound)
Campaign

3.2 Salesforce Lead Screenshot

You might also like