Overview
The Perfex CRM integration allows you to:- Import contacts from Perfex CRM
- Sync customer and lead data automatically
- Trigger campaigns based on CRM events
- Keep contact information synchronized
- Track campaign results in your CRM
Prerequisites
- Perfex CRM installation (v2.3+)
- Admin access to Perfex CRM
- TelemanAI plugin for Perfex CRM
- API access enabled in Perfex
Setup Instructions
Install TelemanAI Plugin in Perfex
- Download the TelemanAI plugin for Perfex CRM
- Extract to
perfex_crm/modules/teleman/ - In Perfex admin, go to Setup → Modules
- Find “TelemanAI Integration” and click Activate
Configure Perfex in TelemanAI
- Log in to TelemanAI dashboard
- Navigate to Integrations → Perfex CRM
- Enter your Perfex configuration:
The admin email must match a staff member in Perfex CRM.
- Click Save Configuration
Generate API Token
- In TelemanAI, click Generate Token
- This sends a request to your Perfex installation
- Perfex validates the email and generates a token
- The token is automatically saved in TelemanAI
Token Generation Flow
The integration uses a secure token exchange:Request from TelemanAI
Response from Perfex
Importing Contacts from Perfex
Fetch Contacts
In TelemanAI:
- Go to Integrations → Perfex CRM
- Click Fetch Data
- TelemanAI retrieves all contacts from Perfex
Review Contact Preview
The system displays fetched contacts:
- Contact name (firstname + lastname)
- Phone number
- Email address
- Company name
- Contact type (customer/lead)
API Endpoints
Fetch Contacts Endpoint
Perfex Plugin Implementation
Module Structure
Token Generation Endpoint
controllers/Teleman.php:Routes Configuration
perfex_crm/application/config/routes.php: Add these routes:Controller Reference
TelemanAI controller implementation (seePerfexController.php):
Key Methods
| Method | Description | Line Reference |
|---|---|---|
index() | Display integration page | 16-27 |
store() | Save Perfex configuration | 29-60 |
generate_token() | Request token from Perfex | 65-133 |
fetch_data() | Fetch contacts from Perfex | 138-209 |
store_to_database() | Import contacts to TelemanAI | 214-260 |
Routes
Defined inroutes/perfex.php:
| Route | Method | Controller Action |
|---|---|---|
/dashboard/perfex | GET | index |
/dashboard/perfex/store | POST | store |
/dashboard/perfex/token | POST | generate_token |
/dashboard/perfex/fetch_data | GET | fetch_data |
/dashboard/perfex/store_data | GET | store_to_database |
Database Storage
Configuration stored inthird_party table:
Campaign Triggers
Trigger on New Customer
In Perfex plugin:Trigger on Invoice Overdue
Trigger on Lead Status Change
Troubleshooting
Token Generation Failed
Token Generation Failed
Problem: “The connection is failed” errorSolution:
- Verify Perfex URL is correct and accessible
- Ensure the TelemanAI plugin is installed and activated
- Check that the email exists in Perfex staff
- Test the endpoint manually:
- Review Perfex error logs
No Contacts Fetched
No Contacts Fetched
Problem: Fetch returns empty or failsSolution:
- Verify contacts have phone numbers in Perfex
- Check that primary contacts are set for customers
- Ensure the API token is valid
- Test the contacts endpoint:
Authentication Error
Authentication Error
Problem: 401 Unauthorized when fetching dataSolution:
- Regenerate the API token
- Verify email and token match in the request
- Check that the token hasn’t been modified in the database
- Ensure the staff member still exists in Perfex
Module Not Found
Module Not Found
Problem: TelemanAI plugin doesn’t appear in PerfexSolution:
- Verify plugin is in correct directory:
modules/teleman/ - Check file permissions (755 for directories, 644 for files)
- Ensure
teleman.phpexists in the module root - Clear Perfex cache
- Check Perfex system requirements are met
Duplicate Contacts
Duplicate Contacts
Problem: Same contacts imported multiple timesSolution:
- TelemanAI checks phone numbers to prevent duplicates
- Ensure phone numbers are formatted consistently in Perfex
- Normalize phone formats before import
- Check the
referencefield to identify source
Security Best Practices
Advanced Configuration
Custom Fields Mapping
Map Perfex custom fields to TelemanAI:Selective Contact Sync
Sync only specific customer groups:Webhook Integration
Receive updates from TelemanAI:Next Steps
Contact Management
Manage your Perfex contacts in TelemanAI
Campaign Automation
Automate campaigns based on CRM events
Analytics
Track campaign performance
API Reference
Complete API documentation