๐ฏ Smart Linking
Automatically links contacts based on common email or phone number
๐๏ธ Hierarchy System
Maintains oldest contact as primary, newer ones as secondary
๐ Contact Merging
Intelligently merges separate primary contacts when they share information
๐ Comprehensive Tracking
Consolidates all emails and phone numbers for a customer
POST
/identify
Core endpoint that identifies and links customer contacts based on email or phone number.
๐ฅ Request Body
{
"email": "optional_email@example.com",
"phoneNumber": "optional_phone_number"
}
๐ค Response Format
{
"contact": {
"primaryContatctId": 1,
"emails": ["primary@email.com", "secondary@email.com"],
"phoneNumbers": ["123456", "789012"],
"secondaryContactIds": [2, 3]
}
}
๐งช Test Examples
๐ Behavior Examples
1. New Customer:
Input: {"email": "lorraine@hillvalley.edu", "phoneNumber": "123456"}
Result: Creates new primary contact
2. Linking Contact:
Input: {"email": "mcfly@hillvalley.edu", "phoneNumber": "123456"}
Result: Links to existing contact with same phone number
3. Merging Contacts:
Input: {"email": "george@hillvalley.edu", "phoneNumber": "717171"}
Result: Merges two separate primary contacts (older becomes primary)
GET
/health
Returns the current status of the API service.
{
"status": "OK",
"message": "Bitespeed Identity Service is running"
}
GET
/test
Simple API test endpoint that returns current timestamp and environment info.
{
"message": "API is working!",
"timestamp": "2024-05-28T10:30:00.000Z",
"env": "production"
}