Salesforce
This guide shows you how to integrate the ept AI chatbot with Salesforce CRM to provide intelligent sales assistance, lead management, and customer support.
Back to Integrations Overview
Overview
The Salesforce integration enables your AI chatbot to:
- Access Salesforce records and data in real-time
- Provide context-aware responses based on account and opportunity information
- Assist with lead qualification and sales processes
- Integrate with Salesforce workflows and automation
Prerequisites
Before setting up the Salesforce integration, ensure you have:
- Salesforce Account: Active Salesforce Professional, Enterprise, or Unlimited edition
- API Access: Salesforce API credentials with appropriate permissions
- ept AI Setup: Chatbot configured with knowledge sources
- Channel Configuration: Salesforce channel created in ept AI dashboard
Setup Instructions
Step 1: Create Salesforce Connected App
-
Create Connected App in Salesforce:
- Log into Salesforce Setup
- Navigate to Setup > App Manager > New Connected App
- Configure the connected app:
- Connected App Name: "ept AI Integration"
- API Name: "ept_ai_integration"
- Contact Email: Your email address
- Enable OAuth Settings: Check this option
- Callback URL:
https://your-ept-ai-domain.com/oauth/salesforce/callback
- Selected OAuth Scopes:
- Access and manage your data (api)
- Perform requests at any time (refresh_token, offline_access)
-
Get OAuth Credentials:
- After creating the connected app, note the:
- Consumer Key (Client ID)
- Consumer Secret (Client Secret)
- These will be used to establish the OAuth connection
- After creating the connected app, note the:
Step 2: Create Salesforce Integration in ept AI
-
Access Integration Settings:
- Log into your ept AI dashboard
- Navigate to Configuration > Integrations
- Click "Create Integration"
- Select "Salesforce" from the available integrations
-
Configure OAuth Connection:
Consumer Key: your-salesforce-consumer-key
Consumer Secret: your-salesforce-consumer-secret
Instance URL: https://your-instance.salesforce.com
Redirect URL: https://your-ept-ai-domain.com/oauth/salesforce/callback -
Authorize Connection:
- Click "Connect to Salesforce"
- Complete the OAuth authorization flow
- Grant necessary permissions to ept AI
Step 3: Configure Salesforce Channel
-
Create Channel:
- Navigate to Configuration > Channels
- Click "Create Channel"
- Configure the channel:
- Channel Name: "Salesforce Sales Assistant"
- Channel Type: Select "Salesforce"
- Integration: Select the Salesforce integration you created
- Knowledge Source Configuration: Choose sales-focused KSC
-
Configure Channel Settings:
{
"salesforce_channel_config": {
"integration_id": "salesforce_integration_123",
"knowledge_source": "sales-ksc",
"objects": ["Lead", "Contact", "Account", "Opportunity"],
"fields": {
"Lead": ["FirstName", "LastName", "Email", "Company", "Status"],
"Contact": ["FirstName", "LastName", "Email", "AccountId", "Title"],
"Account": ["Name", "Industry", "Type", "BillingCity"],
"Opportunity": ["Name", "Amount", "StageName", "CloseDate", "AccountId"]
}
}
}
Use Cases
Lead Qualification Assistant
The AI can help qualify leads by:
- Accessing lead information from Salesforce
- Asking relevant qualification questions
- Updating lead status and fields based on responses
- Creating follow-up tasks and activities
Opportunity Intelligence
Provide context-aware assistance for opportunities:
- Access opportunity details and stage information
- Provide product recommendations based on opportunity value
- Offer competitive information and pricing guidance
- Suggest next steps based on opportunity stage
Account Management
Enhance account-based interactions:
- Access account information and history
- Provide personalized responses based on account type
- Suggest cross-sell and upsell opportunities
- Track engagement and interactions
Configuration Options
Object and Field Mapping
Configure which Salesforce objects and fields to access:
const salesforceMapping = {
"Lead": {
"fields": ["FirstName", "LastName", "Email", "Company", "Status", "LeadSource"],
"aiContext": "lead_qualification",
"updateTriggers": ["status_change", "email_response"]
},
"Opportunity": {
"fields": ["Name", "Amount", "StageName", "CloseDate", "AccountId", "Type"],
"aiContext": "opportunity_management",
"updateTriggers": ["stage_change", "amount_update"]
},
"Account": {
"fields": ["Name", "Industry", "Type", "BillingCity", "AnnualRevenue"],
"aiContext": "account_intelligence",
"updateTriggers": ["revenue_change", "industry_update"]
}
};
Stage-Based Responses
Configure AI responses based on Salesforce stages:
const stageConfig = {
"Lead": {
"New": {
"aiPrompt": "This is a new lead. Focus on initial qualification and interest assessment.",
"knowledgeSources": ["lead-qualification", "product-overview"]
},
"Qualified": {
"aiPrompt": "This lead is qualified. Focus on solution presentation and next steps.",
"knowledgeSources": ["product-details", "pricing", "case-studies"]
}
},
"Opportunity": {
"Prospecting": {
"aiPrompt": "Opportunity is in prospecting stage. Focus on discovery and needs assessment.",
"knowledgeSources": ["discovery-questions", "solution-overview"]
},
"Qualification": {
"aiPrompt": "Opportunity is being qualified. Focus on BANT qualification and value proposition.",
"knowledgeSources": ["qualification-framework", "value-proposition"]
},
"Proposal": {
"aiPrompt": "Opportunity is in proposal stage. Focus on proposal support and competitive positioning.",
"knowledgeSources": ["proposal-templates", "competitive-intelligence"]
}
}
};
Best Practices
Data Security
- Use OAuth 2.0 for secure authentication
- Implement proper token refresh mechanisms
- Respect Salesforce API limits and guidelines
- Log all API interactions for compliance
Response Quality
- Train the AI on your specific sales process
- Include Salesforce-specific terminology and workflows
- Configure appropriate escalation paths
- Monitor and optimize response accuracy
Integration Strategy
- Align with existing Salesforce workflows
- Use Salesforce automation for follow-up actions
- Create consistent handoff processes
- Track conversion metrics and ROI
Troubleshooting
Common Issues
Authentication Errors
- Verify Consumer Key and Secret are correct
- Check OAuth callback URL configuration
- Ensure connected app is properly configured
- Test authentication outside of ept AI
Data Access Issues
- Verify API permissions and field-level security
- Check object and field accessibility
- Test with a single record first
- Review API response logs
Integration Problems
- Check Salesforce API version compatibility
- Verify network connectivity and firewall settings
- Test with Salesforce sandbox environment
- Review error logs and API limits
Debugging Tips
// Test Salesforce API connection
const testSalesforceConnection = async () => {
try {
const response = await fetch(`${instanceUrl}/services/data/v58.0/sobjects/Lead/describe`, {
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json'
}
});
if (response.ok) {
console.log('Salesforce API connection successful');
} else {
console.error('Salesforce API connection failed:', response.status);
}
} catch (error) {
console.error('Salesforce API error:', error);
}
};
Next Steps
After setting up your Salesforce integration:
- Monitor Performance - Track lead conversion and opportunity metrics
- Optimize Responses - Improve AI responses based on sales outcomes
- Scale Integration - Consider additional CRM integrations
Related Documentation
- Preparing the AI - Set up knowledge sources for sales
- Context-Aware Chat - Add intelligence to your chatbot
- HubSpot Integration - Alternative CRM integration