Skip to main content

Salesforce Integration Template

Integrate your mid-call actions with Salesforce, the world’s leading CRM system. This integration offers extensive capabilities for enterprise workflows, complex sales processes, and scalable customer relationship management.

Overview & Enterprise Features

Enterprise CRM Integration

  • Full Salesforce object support (Leads, Contacts, Accounts, Opportunities)
  • Custom objects and fields
  • Salesforce workflows and triggers
  • Multi-org support for large enterprises

Advanced Sales Features

  • Territory management integration
  • Sales process and stage management
  • Einstein AI lead scoring
  • Revenue Cloud integration

Salesforce API Setup

1. Create Connected App

1

Setup Navigation

  • Log in to Salesforce as an admin
  • Go to “Setup” (gear icon)
  • Navigate to “Apps” → “App Manager”
2

Configure Connected App

App-Details:
  Connected App Name: "Famulor Mid-call Actions"
  API Name: "Famulor_Mid_Call_Tools"
  Contact Email: your-admin@company.com
  
OAuth Settings:
  Enable OAuth Settings: 
  Callback URL: https://app.famulor.de/oauth/callback
  Selected OAuth Scopes:
    - "Access and manage your data (api)"
    - "Perform requests on your behalf at any time (refresh_token, offline_access)"
    - "Access your basic information (id, profile, email, address, phone)"
3

Secure API Credentials

After creation:
  • Note Consumer Key (Client ID)
  • Note Consumer Secret (Client Secret)
  • These credentials are required for tool authentication
4

Set User Permissions

Profile Permissions (for Service User):
  - "API Enabled" 
  - "View All Data" (or specific object permissions)
  - "Modify All Data" (only for write operations)
  
Optional - IP Restrictions:
  - Define trusted IP ranges
  - Configure VPN-based access

2. Authentication Flow

Authentication-Type: "OAuth 2.0"
Grant Type: "Client Credentials" or "Authorization Code"

Token Endpoint:
  URL: https://login.salesforce.com/services/oauth2/token
  Method: POST
  
Headers:
  Content-Type: "application/x-www-form-urlencoded"
  
Body:
  grant_type: "client_credentials"
  client_id: "{consumer_key}"
  client_secret: "{consumer_secret}"
  username: "{sf_username}"  # for Username-Password flow
  password: "{sf_password}{security_token}"

Lead Management Tool

1. Lead Lookup Tool

ParameterValue
Function Nameget_salesforce_lead
Description”Retrieves lead information from Salesforce based on email or phone number.”
HTTP MethodGET
URLhttps://{instance}.salesforce.com/services/data/v60.0/query
Timeout8000ms
SOQL Query Examples:
  
  Email-based Search:
    q: "SELECT Id, FirstName, LastName, Company, Email, Phone, Status, 
        Rating, LeadSource, CreatedDate, LastModifiedDate 
        FROM Lead 
        WHERE Email = '{email}' AND IsConverted = false"
  
  Phone-based Search:
    q: "SELECT Id, FirstName, LastName, Company, Email, Phone, Status,
        Rating, Industry, AnnualRevenue 
        FROM Lead 
        WHERE Phone = '{phone}' OR MobilePhone = '{phone}'"
  
  Extended Search with Custom Fields:
    q: "SELECT Id, Name, Email, Lead_Score__c, Next_Follow_Up__c,
        Competitor_Mentioned__c, Budget_Range__c
        FROM Lead 
        WHERE Email = '{email}'"

2. Lead Creation Tool

Function Name: create_salesforce_lead
HTTP Method: POST
URL: https://{instance}.salesforce.com/services/data/v60.0/sobjects/Lead

Headers:
  Authorization: "Bearer {access_token}"
  Content-Type: "application/json"

3. Lead Update & Qualification

{
  "type": "object",
  "properties": {
    "lead_id": {
      "type": "string",
      "description": "Salesforce lead ID for update"
    },
    "status": {
      "type": "string",
      "enum": ["Open - Not Contacted", "Working - Contacted", "Closed - Converted", "Closed - Not Converted"],
      "description": "New lead status"
    },
    "rating": {
      "type": "string", 
      "enum": ["Hot", "Warm", "Cold"],
      "description": "Lead rating based on the conversation"
    },
    "qualification_notes": {
      "type": "string",
      "description": "BANT qualification and conversation notes"
    },
    "next_action": {
      "type": "string",
      "description": "Recommended next steps"
    },
    "assigned_owner": {
      "type": "string",
      "description": "Salesforce user ID for assignment"
    }
  },
  "required": ["lead_id"]
}

Contact & Account Management

1. Contact Lookup with Account Information

-- SOQL for Contact with Account data
SELECT Id, FirstName, LastName, Email, Phone, Title,
       Account.Id, Account.Name, Account.Industry, Account.AnnualRevenue,
       Account.NumberOfEmployees, Account.Type,
       LastActivityDate, CreatedDate,
       Custom_Field__c, Lifecycle_Stage__c
FROM Contact 
WHERE Email = '{email}'
-- Contact with Opportunities and Cases
SELECT Id, Name, Email, Phone,
       (SELECT Id, Name, StageName, Amount, CloseDate FROM Opportunities),
       (SELECT Id, Subject, Status, Priority FROM Cases WHERE IsClosed = false),
       Account.Name, Account.Industry
FROM Contact 
WHERE Email = '{email}' OR Phone = '{phone}'

2. Account Enrichment

Tool: get_salesforce_account
SOQL: "SELECT Id, Name, Industry, AnnualRevenue, NumberOfEmployees,
              BillingAddress, Website, Phone, Type, 
              Parent.Name, Owner.Name,
              Last_Activity__c, Health_Score__c
       FROM Account 
       WHERE Name LIKE '%{company_name}%' OR Website LIKE '%{domain}%'"

Use Case: Enrich company data during calls

Opportunity Management

1. Opportunity Tracking

2. Opportunity Creation Tool

Function Name: create_salesforce_opportunity
Method: POST
URL: /services/data/v60.0/sobjects/Opportunity

Description: "Creates a new opportunity in Salesforce based on qualified lead conversation"
{
  "Name": "{opportunity_name}",
  "AccountId": "{account_id}",
  "ContactId": "{primary_contact_id}",
  "StageName": "Prospecting",
  "CloseDate": "{estimated_close_date}",
  "Amount": "{estimated_amount}",
  "Probability": "{calculated_probability}",
  "LeadSource": "Phone Call",
  "Type": "New Customer",
  "Description": "{opportunity_description}",
  "NextStep": "{next_action_item}",
  "Pricebook2Id": "{standard_pricebook_id}",
  "Budget_Confirmed__c": "{budget_status}",
  "Decision_Maker__c": "{decision_maker_identified}",
  "Timeline_Confirmed__c": "{timeline_status}",
  "Competitor__c": "{mentioned_competitors}",
  "Pain_Points__c": "{customer_challenges}"
}

3. Sales Process Integration

Salesforce Stage Mapping:
  "Prospect Reached" → StageName: "Prospecting"
  "Needs Identified" → StageName: "Qualification"
  "Budget Confirmed" → StageName: "Needs Analysis"
  "Demo Scheduled" → StageName: "Value Proposition"
  "Proposal Requested" → StageName: "Id. Decision Makers"
  "Negotiation Started" → StageName: "Proposal/Price Quote"
  "Contract Sent" → StageName: "Negotiation/Review"
  "Deal Closed" → StageName: "Closed Won"

Automatic Stage Progression:
  - Based on conversation content
  - Triggers for workflow rules
  - Integration with Sales Process Builder

Activity & Task Management

Automatic Activity Logging

{
  "sobjectType": "Task",
  "WhoId": "{contact_id}",
  "WhatId": "{account_or_opportunity_id}", 
  "Subject": "Follow-up Call - {customer_name}",
  "Status": "Not Started",
  "Priority": "High",
  "ActivityDate": "{follow_up_date}",
  "Description": "{call_summary}",
  "Type": "Call",
  "TaskSubtype": "Call",
  "Call_Outcome__c": "{call_result}",
  "Next_Steps__c": "{action_items}",
  "OwnerId": "{assigned_user_id}"
}
Event Types for Mid-Call Logging:
  
  Inbound Call Event:
    Subject: "Inbound Call - {topic}"
    Type: "Call"
    DurationInMinutes: {call_length}
    
  Demo Request Event:
    Subject: "Demo Scheduled"
    Type: "Meeting"
    StartDateTime: {demo_date}
    
  Follow-up Task:
    Subject: "Send Proposal"
    ActivityDate: {due_date}
    Priority: "High"

Territory & Team Management

1. Lead Routing Based on Territory

-- Territory lookup for automatic assignment
SELECT Id, Name, 
       (SELECT User.Id, User.Name FROM UserTerritories WHERE RoleInTerritory = 'Sales Rep')
FROM Territory2
WHERE State__c = '{customer_state}' 
   OR Industry__c = '{customer_industry}'
   OR Company_Size__c = '{company_size_category}'

2. Escalation Management

Custom Objects & Industry Solutions

1. Industry-Specific Objects

Custom Objects:
  - Investment_Profile__c
  - Risk_Assessment__c  
  - Compliance_Record__c
  - Portfolio_Summary__c
  
Mid-Call Integration:
  - Risk profile queries during advisory calls
  - Portfolio performance updates
  - Compliance status checks
  - Product suitability assessments
Custom Objects:
  - Patient_Record__c (HIPAA-compliant)
  - Treatment_Plan__c
  - Insurance_Verification__c
  - Appointment_History__c
  
Special Considerations:
  - PHI handling with field-level security
  - Audit trail for all data accesses
  - Consent management integration
Custom Objects:
  - Property_Listing__c
  - Showing_Request__c
  - Market_Analysis__c
  - Financing_Pre_Approval__c
  
Workflow:
  - Property interest capture
  - Automatic showing scheduling
  - Financing qualification
  - Market update delivery

Advanced Features

1. Flow & Process Builder Integration

Flow Trigger Examples:
  
  Lead Created Flow:
    Trigger: Lead creation via API
    Actions:
      - Perform duplicate check
      - Enrichment via Data.com
      - Auto-assignment rules
      - Send welcome email
      - Create task for first contact
  
  Opportunity Stage Change:
    Trigger: Stage update via mid-call action
    Actions:
      - Approval process for large deals
      - Quote generation for proposal stage
      - Contract template creation
      - Revenue forecast updates

2. Einstein Analytics Integration

Dashboard integration for mid-call analytics:
  
  Call Volume Metrics:
    - Calls per hour/day
    - Conversion rates by source
    - Average call duration
    - Lead quality scores
  
  Performance KPIs:
    - Response times after lead creation
    - Lead-to-opportunity conversion
    - Opportunity stage progression
    - Win rate trends
Einstein Predictions:
  
  Lead Scoring Model:
    Input: Company size, Industry, Budget, Timeline
    Output: Conversion probability score
    
  Opportunity Scoring:
    Input: Stage history, Contact engagement, Deal size
    Output: Close probability + timeline
    
  Churn Risk Assessment:
    Input: Activity history, Support cases, Usage metrics
    Output: Churn risk score + intervention recommendations

Performance & Monitoring

API Limits & Governance

Limit TypeStandardEnterpriseBest Practice
Daily API Requests15,000100,000+Request pooling
Concurrent Requests25100Queue management
Data Storage1GBUnlimitedArchive strategy
SOQL Queries per Transaction100100Bulk operations

Monitoring & Alerting

1

API Usage Monitoring

Metrics to monitor:
  - API request volume
  - Response times
  - Error rates by endpoint
  - Quota utilization
2

Business Impact Tracking

KPIs:
  - Lead creation rate via mid-call actions
  - Conversion rate improvement
  - Sales cycle reduction
  - Revenue attribution

Enterprise Integration Patterns

Expand your Salesforce integration:
Compliance Notice: For enterprise Salesforce integrations, you may need to observe specific compliance requirements (SOX, HIPAA, etc.). Please consult your compliance team before implementation.
Scaling Tip: Start with standard objects (Lead, Contact, Opportunity) and gradually expand to custom objects and advanced features. Salesforce provides extensive sandbox environments for safe testing.