Intercom Connector
เชื่อมต่อ Intercom workspace ของคุณกับ Brevo ผ่าน Tajo เพื่อการส่งข้อความลูกค้าที่รวมกัน การติดตาม conversation และ marketing automation ที่ขับเคลื่อนด้วย engagement ที่ขับเคลื่อนด้วยข้อมูล support และสินค้า
ภาพรวม
| คุณสมบัติ | ค่า |
|---|---|
| แพลตฟอร์ม | Intercom |
| หมวดหมู่ | Support |
| ความซับซ้อนในการตั้งค่า | ปานกลาง |
| การผสานรวมอย่างเป็นทางการ | ใช่ |
| ข้อมูลที่ซิงค์ | ผู้ติดต่อ Conversations บริษัท เหตุการณ์ |
| API Base URL | https://api.intercom.io |
ฟีเจอร์
- การซิงค์ผู้ติดต่อ - การซิงค์แบบ bidirectional ของ Intercom users และ leads กับ Brevo contacts
- การติดตาม Conversation - ซิงค์ข้อมูล conversation สำหรับการแบ่ง segment ที่ขับเคลื่อนด้วย support
- การแมปบริษัท - เชื่อมผู้ติดต่อกับบริษัทสำหรับ account-based workflows
- Custom attributes - แมป Intercom custom attributes ไปยัง Brevo contact fields
- การติดตามเหตุการณ์ - ซิงค์ custom events และกิจกรรมผู้ใช้สำหรับการกำหนดเป้าหมายเชิงพฤติกรรม
- การซิงค์ Tag - แมป Intercom tags ไปยัง Brevo list membership หรือ attributes
- ข้อมูล Messenger - ติดตาม engagement การส่งข้อความในแอปและการโต้ตอบแชท
- การผสานรวม AI agent - ซิงค์ผลลัพธ์การสนทนา AI agent กับ Brevo
ข้อกำหนดเบื้องต้น
ก่อนเริ่มต้น ตรวจสอบให้แน่ใจว่าคุณมี:
- Intercom workspace (แผน Starter, Pro หรือ Premium)
- Intercom app พร้อม access token (private app) หรือกำหนดค่า OAuth (public app)
- บัญชี Brevo ที่มีสิทธิ์เข้าถึง API
- บัญชี Tajo
การยืนยันตัวตน
Access Token (Private App)
สำหรับ integrations ส่วนตัวที่เข้าถึงข้อมูล workspace ของคุณเอง
- ไปที่ Developer Hub > Your Apps > Create new app
- เชื่อมกับ Intercom workspace ของคุณ
- คัดลอก access token
curl https://api.intercom.io/contacts \ -H "Authorization: Bearer {access_token}" \ -H "Content-Type: application/json" \ -H "Intercom-Version: 2.11"OAuth 2.0 (Public App)
สำหรับ integrations ที่เข้าถึงข้อมูล Intercom ของลูกค้ารายอื่น
# Authorization URLhttps://app.intercom.com/oauth?client_id={client_id}&state={state}
# Token exchangecurl -X POST https://api.intercom.io/auth/eagle/token \ -d "client_id={client_id}" \ -d "client_secret={client_secret}" \ -d "code={auth_code}"การกำหนดเวอร์ชัน API
รวมส่วนหัว Intercom-Version ในคำขอของคุณเสมอ Tajo ใช้ API เวอร์ชัน 2.11 ตามค่าเริ่มต้น ตรวจสอบ Intercom changelog สำหรับการเปลี่ยนแปลงที่ทำให้ใช้ไม่ได้
การกำหนดค่า
การตั้งค่าพื้นฐาน
connectors: intercom: enabled: true access_token: "${INTERCOM_ACCESS_TOKEN}" api_version: "2.11"
# Data sync options sync: contacts: true conversations: true companies: true events: true tags: true
# Sync direction direction: intercom_to_brevo
# Brevo list assignment lists: all_users: 35 active_conversations: 36 leads: 37การแมปฟิลด์
แมปข้อมูลผู้ติดต่อ Intercom กับแอตทริบิวต์ผู้ติดต่อ Brevo:
การแมปเริ่มต้น
| Parameter | Type | Description |
|---|---|---|
email required | string | ที่อยู่อีเมลผู้ติดต่อ (unique identifier) |
name optional | string | ชื่อเต็ม แยกเป็น FIRSTNAME/LASTNAME |
phone optional | string | แมปกับแอตทริบิวต์ SMS สำหรับ WhatsApp/SMS |
role optional | string | ประเภทผู้ติดต่อ: user หรือ lead |
company.name optional | string | ชื่อบริษัทที่เกี่ยวข้อง |
signed_up_at optional | timestamp | วันที่ลงทะเบียนผู้ใช้ |
last_seen_at optional | timestamp | timestamp ที่ active ล่าสุด |
custom_attributes optional | object | คู่ key-value ของ custom attributes |
การแมป Custom Attribute
field_mapping: # Standard fields email: email name: FULLNAME phone: SMS
# Engagement fields signed_up_at: SIGNUP_DATE last_seen_at: LAST_ACTIVE session_count: SESSION_COUNT unsubscribed_from_emails: UNSUBSCRIBED
# Company fields company.name: COMPANY_NAME company.plan: COMPANY_PLAN company.size: COMPANY_SIZE
# Custom attributes custom_attributes.plan_tier: PLAN_TIER custom_attributes.feature_usage: FEATURE_USAGEAPI Endpoints
Contacts API
| เมธอด | Endpoint | คำอธิบาย |
|---|---|---|
GET | /contacts | แสดงรายการผู้ติดต่อทั้งหมด |
POST | /contacts | สร้างผู้ติดต่อ |
PUT | /contacts/{id} | อัปเดตผู้ติดต่อ |
GET | /contacts/{id} | ดึงผู้ติดต่อ |
POST | /contacts/search | ค้นหาผู้ติดต่อ |
DELETE | /contacts/{id} | Archive ผู้ติดต่อ |
Conversations API
| เมธอด | Endpoint | คำอธิบาย |
|---|---|---|
GET | /conversations | แสดงรายการ conversations |
GET | /conversations/{id} | ดึง conversation |
POST | /conversations | สร้าง conversation |
POST | /conversations/{id}/reply | ตอบกลับ conversation |
POST | /conversations/{id}/parts | เพิ่มส่วน conversation |
Companies API
| เมธอด | Endpoint | คำอธิบาย |
|---|---|---|
GET | /companies | แสดงรายการบริษัท |
POST | /companies | สร้างหรืออัปเดตบริษัท |
GET | /companies/{id} | ดึงบริษัท |
GET | /companies/{id}/contacts | แสดงรายการผู้ติดต่อของบริษัท |
Events API
| เมธอด | Endpoint | คำอธิบาย |
|---|---|---|
POST | /events | ส่งเหตุการณ์ |
GET | /events?type=user&intercom_user_id={id} | แสดงรายการเหตุการณ์ผู้ใช้ |
เหตุการณ์
เหตุการณ์ Conversation
| เหตุการณ์ | Trigger | กรณีการใช้งาน |
|---|---|---|
conversation.created | เริ่ม conversation ใหม่ | การแจ้งเตือน support ticket |
conversation.closed | แก้ไข conversation แล้ว | Trigger การสำรวจ CSAT |
conversation.rating.added | ส่ง rating แล้ว | การติดตามความพึงพอใจ |
conversation.snoozed | Snooze conversation แล้ว | การกำหนดเวลาติดตาม |
เหตุการณ์ผู้ติดต่อ
| เหตุการณ์ | Trigger | กรณีการใช้งาน |
|---|---|---|
contact.created | เพิ่มผู้ติดต่อใหม่ | Welcome sequence |
contact.updated | ข้อมูลผู้ติดต่อเปลี่ยน | การซิงค์ attribute |
contact.deleted | Archive ผู้ติดต่อแล้ว | การทำความสะอาด |
contact.tag.created | เพิ่ม tag ให้ผู้ติดต่อ | การอัปเดต segment |
เหตุการณ์ผู้ใช้
| เหตุการณ์ | Trigger | กรณีการใช้งาน |
|---|---|---|
user.created | ผู้ใช้ใหม่ลงทะเบียน | Onboarding flow |
user.email.updated | อีเมลเปลี่ยนแล้ว | การรวมผู้ติดต่อ |
user.unsubscribed | ยกเลิกสมัครจากอีเมล | การอัปเดตการตั้งค่า |
ตัวอย่างโค้ด
เริ่มต้น Connector
import { TajoClient } from '@tajo/sdk';
const tajo = new TajoClient({ apiKey: process.env.TAJO_API_KEY, brevoApiKey: process.env.BREVO_API_KEY});
// Connect Intercomawait tajo.connectors.connect('intercom', { accessToken: process.env.INTERCOM_ACCESS_TOKEN, apiVersion: '2.11'});ซิงค์ผู้ติดต่อและ Conversations
// Full sync of contacts and conversation dataawait tajo.connectors.sync('intercom', { type: 'full', resources: ['contacts', 'conversations', 'companies'], since: '2023-01-01'});
// Check sync statusconst status = await tajo.connectors.status('intercom');console.log(status);// {// connected: true,// lastSync: '2024-01-15T10:30:00Z',// contactsSynced: 14200,// conversationsSynced: 28400,// companiesSynced: 2100// }จัดการ Intercom Webhooks
import crypto from 'crypto';
app.post('/webhooks/intercom', async (req, res) => { const signature = req.get('X-Hub-Signature'); const expectedSig = 'sha1=' + crypto .createHmac('sha1', process.env.INTERCOM_CLIENT_SECRET) .update(JSON.stringify(req.body)) .digest('hex');
if (signature !== expectedSig) { return res.status(401).send('Unauthorized'); }
await tajo.connectors.handleWebhook('intercom', { topic: req.body.topic, data: req.body.data });
res.status(200).send('OK');});ขีดจำกัดอัตรา
Intercom ใช้ rate limits ตามแผนของคุณ:
| แผน | ขีดจำกัดอัตรา | รายละเอียด |
|---|---|---|
| Starter | 20 คำขอ/10 วินาที | ต่อ app |
| Pro | 50 คำขอ/10 วินาที | ต่อ app |
| Premium | 100 คำขอ/10 วินาที | ต่อ app |
| Search endpoint | 1 คำขอ/วินาที | ต่อ app |
| Scroll endpoint | 1 คำขอ/นาที | ต่อ app |
ขีดจำกัดเพิ่มเติม:
- Bulk operations: 15 ผู้ติดต่อต่อ bulk request
- Event submissions: 500 เหตุการณ์/วินาทีต่อ workspace
- Webhook delivery: ลองใหม่อัตโนมัติเป็นเวลา 24 ชั่วโมง
- Data export: 1 concurrent export
การตอบกลับ Rate Limit
Intercom ส่งคืน 429 Too Many Requests พร้อมส่วนหัว Retry-After ใช้ exponential backoff และเคารพช่วงเวลา retry
การแก้ไขปัญหา
ปัญหาทั่วไป
| ปัญหา | สาเหตุ | วิธีแก้ |
|---|---|---|
| 401 Unauthorized | Token ไม่ถูกต้องหรือหมดอายุ | สร้าง access token ใหม่ใน Developer Hub |
| ผู้ติดต่อไม่ซิงค์ | ฟิลด์อีเมลหายไป | Intercom leads อาจไม่มีอีเมล; กรองตาม role |
| ข้อมูล Conversation ว่างเปล่า | App ไม่มี conversation scope | อนุมัติใหม่พร้อมสิทธิ์อ่าน conversation |
| ไม่ได้รับ Webhook | ไม่ได้ลงทะเบียน webhook | กำหนดค่า webhooks ใน Developer Hub settings |
| API version ไม่ตรงกัน | การเปลี่ยนแปลงที่ทำให้ใช้ไม่ได้ในเวอร์ชันใหม่ | Pin API version ด้วยส่วนหัว Intercom-Version |
โหมด Debug
เปิดใช้งาน verbose logging:
connectors: intercom: debug: true log_level: verbose log_webhooks: trueทดสอบการเชื่อมต่อ
tajo connectors test intercom# ✓ API connection successful# ✓ Contacts readable# ✓ Conversations readable# ✓ Companies readable# ✓ Webhooks registeredแนวทางปฏิบัติที่ดีที่สุด
- Pin API version - ระบุ
Intercom-Versionเสมอเพื่อหลีกเลี่ยงการเปลี่ยนแปลงที่ทำให้ใช้ไม่ได้ - ใช้ search API อย่างมีประสิทธิภาพ - ใช้ตัวกรองและ pagination เพื่อลดการถ่ายโอนข้อมูล
- ซิงค์ทั้ง users และ leads - บันทึก funnel ทั้งหมดใน Brevo
- แมป conversation tags - ใช้ conversation tags สำหรับ post-support marketing segments
- ติดตาม custom events - ส่ง product events สำคัญไปยัง Intercom สำหรับการกำหนดเป้าหมายเชิงพฤติกรรม
- จัดการการรวมผู้ติดต่อ - ใช้ merge logic สำหรับผู้ติดต่อที่ซ้ำกัน
ความปลอดภัย
- Access Token - การยืนยันตัวตนด้วย bearer token สำหรับ private apps
- OAuth 2.0 - Delegated authorization สำหรับ public apps พร้อม client secret
- การตรวจสอบ Webhook - การตรวจสอบ HMAC SHA-1 signature ผ่าน
X-Hub-Signature - การเข้ารหัส TLS - การสื่อสาร API ทั้งหมดเข้ารหัสผ่าน HTTPS
- การควบคุมการเข้าถึงข้อมูล - การเข้าถึงข้อมูลแบบละเอียดต่อการกำหนดค่า app