Intercom Connector

เชื่อมต่อ Intercom workspace ของคุณกับ Brevo ผ่าน Tajo เพื่อการส่งข้อความลูกค้าที่รวมกัน การติดตาม conversation และ marketing automation ที่ขับเคลื่อนด้วย engagement ที่ขับเคลื่อนด้วยข้อมูล support และสินค้า

ภาพรวม

คุณสมบัติค่า
แพลตฟอร์มIntercom
หมวดหมู่Support
ความซับซ้อนในการตั้งค่าปานกลาง
การผสานรวมอย่างเป็นทางการใช่
ข้อมูลที่ซิงค์ผู้ติดต่อ Conversations บริษัท เหตุการณ์
API Base URLhttps://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

ข้อกำหนดเบื้องต้น

ก่อนเริ่มต้น ตรวจสอบให้แน่ใจว่าคุณมี:

  1. Intercom workspace (แผน Starter, Pro หรือ Premium)
  2. Intercom app พร้อม access token (private app) หรือกำหนดค่า OAuth (public app)
  3. บัญชี Brevo ที่มีสิทธิ์เข้าถึง API
  4. บัญชี Tajo

การยืนยันตัวตน

Access Token (Private App)

สำหรับ integrations ส่วนตัวที่เข้าถึงข้อมูล workspace ของคุณเอง

  1. ไปที่ Developer Hub > Your Apps > Create new app
  2. เชื่อมกับ Intercom workspace ของคุณ
  3. คัดลอก access token
Terminal window
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 ของลูกค้ารายอื่น

Terminal window
# Authorization URL
https://app.intercom.com/oauth?client_id={client_id}&state={state}
# Token exchange
curl -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_USAGE

API 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.snoozedSnooze conversation แล้วการกำหนดเวลาติดตาม

เหตุการณ์ผู้ติดต่อ

เหตุการณ์Triggerกรณีการใช้งาน
contact.createdเพิ่มผู้ติดต่อใหม่Welcome sequence
contact.updatedข้อมูลผู้ติดต่อเปลี่ยนการซิงค์ attribute
contact.deletedArchive ผู้ติดต่อแล้วการทำความสะอาด
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 Intercom
await tajo.connectors.connect('intercom', {
accessToken: process.env.INTERCOM_ACCESS_TOKEN,
apiVersion: '2.11'
});

ซิงค์ผู้ติดต่อและ Conversations

// Full sync of contacts and conversation data
await tajo.connectors.sync('intercom', {
type: 'full',
resources: ['contacts', 'conversations', 'companies'],
since: '2023-01-01'
});
// Check sync status
const 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 ตามแผนของคุณ:

แผนขีดจำกัดอัตรารายละเอียด
Starter20 คำขอ/10 วินาทีต่อ app
Pro50 คำขอ/10 วินาทีต่อ app
Premium100 คำขอ/10 วินาทีต่อ app
Search endpoint1 คำขอ/วินาทีต่อ app
Scroll endpoint1 คำขอ/นาทีต่อ 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 UnauthorizedToken ไม่ถูกต้องหรือหมดอายุสร้าง 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

ทดสอบการเชื่อมต่อ

Terminal window
tajo connectors test intercom
# ✓ API connection successful
# ✓ Contacts readable
# ✓ Conversations readable
# ✓ Companies readable
# ✓ Webhooks registered

แนวทางปฏิบัติที่ดีที่สุด

  1. Pin API version - ระบุ Intercom-Version เสมอเพื่อหลีกเลี่ยงการเปลี่ยนแปลงที่ทำให้ใช้ไม่ได้
  2. ใช้ search API อย่างมีประสิทธิภาพ - ใช้ตัวกรองและ pagination เพื่อลดการถ่ายโอนข้อมูล
  3. ซิงค์ทั้ง users และ leads - บันทึก funnel ทั้งหมดใน Brevo
  4. แมป conversation tags - ใช้ conversation tags สำหรับ post-support marketing segments
  5. ติดตาม custom events - ส่ง product events สำคัญไปยัง Intercom สำหรับการกำหนดเป้าหมายเชิงพฤติกรรม
  6. จัดการการรวมผู้ติดต่อ - ใช้ 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

แหล่งข้อมูลที่เกี่ยวข้อง

Subscribe to updates

developer-docs

Drop your email or phone number — we'll send you what matters next.

auto-detect
ผู้ช่วย AI

สวัสดี! ถามฉันเกี่ยวกับเอกสารได้เลย