---
title: "Trình Kết Nối Intercom"
description: "Hướng dẫn tích hợp Intercom đầy đủ để đồng bộ contacts, conversations, companies và engagement events với Brevo qua Tajo."
url: https://tajo.io/vi/docs/connectors/support/intercom/
markdown: https://tajo.io/vi/docs/connectors/support/intercom.md
lang: vi-VN
robots: noindex
---

Đăng ký quyền truy cập sớm

Nhập tên và địa chỉ email công việc của bạn. Chúng tôi sẽ gửi liên kết để xác nhận yêu cầu truy cập Tajo.

# Trình Kết Nối Intercom

Trạng thái trình kết nối: Dự kiến Chưa được xây dựng. Hiện Tajo chưa chạy trình kết nối này.

| Trường nguồn | Trường đích | Giá trị mẫu |
| --- | --- | --- |
| `record.id` | `source_id` | `record_1042` |
| `record.updated_at` | `updated_at` | `2026-10-18T08:00:00Z` |
| `record.value` | `value` | `sample_value` |

Kết nối Intercom workspace của bạn với Brevo qua Tajo để unified customer messaging, conversation tracking và engagement-driven marketing automation được hỗ trợ bởi dữ liệu support và product của bạn.

## Tổng Quan

| Thuộc Tính | Giá Trị |
| --- | --- |
| **Nền Tảng** | Intercom |
| **Danh Mục** | Support |
| **Độ Phức Tạp Thiết Lập** | Trung Bình |
| **Tích Hợp Chính Thức** | Không |
| **Dữ Liệu Đồng Bộ** | Contacts, Conversations, Companies, Sự Kiện |
| **URL API Cơ Sở** | `https://api.intercom.io` |

## Tính Năng

- **Đồng bộ contact** - Đồng bộ hai chiều Intercom users và leads với contacts Brevo
- **Theo dõi conversation** - Đồng bộ dữ liệu conversation để phân đoạn dựa trên support
- **Ánh xạ company** - Liên kết contacts với companies cho account-based workflows
- **Custom attributes** - Ánh xạ Intercom custom attributes sang trường contact Brevo
- **Theo dõi event** - Đồng bộ custom events và user activities để targeting theo hành vi
- **Đồng bộ tag** - Ánh xạ Intercom tags sang Brevo list membership hoặc thuộc tính
- **Dữ liệu Messenger** - Theo dõi in-app messaging engagement và chat interactions
- **Tích hợp AI agent** - Đồng bộ kết quả conversation AI agent với Brevo

## Yêu Cầu

Trước khi bắt đầu, hãy đảm bảo bạn có:

1. Intercom workspace (gói Starter, Pro, hoặc Premium)
2. Intercom app với access token (private app) hoặc OAuth được cấu hình (public app)
3. Tài khoản Brevo với quyền truy cập API
4. Tài khoản Tajo

## Xác Thực

### Access Token (Private App)

Cho private integrations truy cập dữ liệu workspace của bạn.

1. Vào Developer Hub > Your Apps > Create new app
2. Liên kết với Intercom workspace của bạn
3. Sao chép access token

```bash
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)

Cho integrations truy cập dữ liệu Intercom của khách hàng khác.

```bash
# Authorization URL
https://app.intercom.com/oauth?client_id={client_id}&state={state}

# Đổi token
curl -X POST https://api.intercom.io/auth/eagle/token \
  -d "client_id={client_id}" \
  -d "client_secret={client_secret}" \
  -d "code={auth_code}"
```

Phiên Bản API

Luôn bao gồm header `Intercom-Version` trong requests của bạn. Tajo sử dụng API version 2.11 theo mặc định. Kiểm tra Intercom changelog để biết các thay đổi breaking.

## Cấu Hình

### Thiết Lập Cơ Bản

```yaml
connectors:
  intercom:
    enabled: true
    access_token: "${INTERCOM_ACCESS_TOKEN}"
    api_version: "2.11"

    # Tùy chọn đồng bộ dữ liệu
    sync:
      contacts: true
      conversations: true
      companies: true
      events: true
      tags: true

    # Hướng đồng bộ
    direction: intercom_to_brevo

    # Gán danh sách Brevo
    lists:
      all_users: 35
      active_conversations: 36
      leads: 37
```

### Ánh Xạ Trường

Ánh xạ dữ liệu contact Intercom sang thuộc tính liên hệ Brevo:

#### Ánh Xạ Mặc Định

| Parameter | Type | Description |
| --- | --- | --- |
| `email` required | string | Địa chỉ email liên hệ (định danh duy nhất) |
| `name` optional | string | Tên đầy đủ, tách thành FIRSTNAME/LASTNAME |
| `phone` optional | string | Ánh xạ sang thuộc tính SMS cho WhatsApp/SMS |
| `role` optional | string | Loại contact: user hoặc lead |
| `company.name` optional | string | Tên công ty liên kết |
| `signed_up_at` optional | timestamp | Ngày đăng ký của user |
| `last_seen_at` optional | timestamp | Timestamp hoạt động cuối |
| `custom_attributes` optional | object | Các cặp key-value custom attribute |

#### Ánh Xạ Custom Attribute

```yaml
field_mapping:
  # Trường tiêu chuẩn
  email: email
  name: FULLNAME
  phone: SMS

  # Trường engagement
  signed_up_at: SIGNUP_DATE
  last_seen_at: LAST_ACTIVE
  session_count: SESSION_COUNT
  unsubscribed_from_emails: UNSUBSCRIBED

  # Trường company
  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

| Phương Thức | Endpoint | Mô Tả |
| --- | --- | --- |
| `GET` | `/contacts` | Liệt kê tất cả contacts |
| `POST` | `/contacts` | Tạo contact |
| `PUT` | `/contacts/{id}` | Cập nhật contact |
| `GET` | `/contacts/{id}` | Lấy contact |
| `POST` | `/contacts/search` | Tìm kiếm contacts |
| `DELETE` | `/contacts/{id}` | Archive contact |

### Conversations API

| Phương Thức | Endpoint | Mô Tả |
| --- | --- | --- |
| `GET` | `/conversations` | Liệt kê conversations |
| `GET` | `/conversations/{id}` | Lấy conversation |
| `POST` | `/conversations` | Tạo conversation |
| `POST` | `/conversations/{id}/reply` | Trả lời conversation |
| `POST` | `/conversations/{id}/parts` | Thêm phần conversation |

### Companies API

| Phương Thức | Endpoint | Mô Tả |
| --- | --- | --- |
| `GET` | `/companies` | Liệt kê companies |
| `POST` | `/companies` | Tạo hoặc cập nhật company |
| `GET` | `/companies/{id}` | Lấy company |
| `GET` | `/companies/{id}/contacts` | Liệt kê company contacts |

### Events API

| Phương Thức | Endpoint | Mô Tả |
| --- | --- | --- |
| `POST` | `/events` | Gửi event |
| `GET` | `/events?type=user&intercom_user_id={id}` | Liệt kê user events |

## Sự Kiện

### Sự Kiện Conversation

| Sự Kiện | Kích Hoạt | Trường Hợp Sử Dụng |
| --- | --- | --- |
| `conversation.created` | Conversation mới bắt đầu | Cảnh báo support ticket |
| `conversation.closed` | Conversation được giải quyết | Kích hoạt CSAT survey |
| `conversation.rating.added` | Rating được gửi | Theo dõi satisfaction |
| `conversation.snoozed` | Conversation bị snooze | Lên lịch follow-up |

### Sự Kiện Contact

| Sự Kiện | Kích Hoạt | Trường Hợp Sử Dụng |
| --- | --- | --- |
| `contact.created` | Contact mới được thêm | Chuỗi chào mừng |
| `contact.updated` | Dữ liệu contact thay đổi | Đồng bộ thuộc tính |
| `contact.deleted` | Contact bị archive | Dọn dẹp |
| `contact.tag.created` | Tag được thêm vào contact | Cập nhật segment |

### Sự Kiện User

| Sự Kiện | Kích Hoạt | Trường Hợp Sử Dụng |
| --- | --- | --- |
| `user.created` | User mới đăng ký | Luồng onboarding |
| `user.email.updated` | Email thay đổi | Merge contact |
| `user.unsubscribed` | Hủy đăng ký email | Cập nhật tùy chọn |

## Ví Dụ Code

### Khởi Tạo Trình Kết Nối

```javascript
import { TajoClient } from '@tajo/sdk';

const tajo = new TajoClient({
  apiKey: process.env.TAJO_API_KEY,
  brevoApiKey: process.env.BREVO_API_KEY
});

// Kết nối Intercom
await tajo.connectors.connect('intercom', {
  accessToken: process.env.INTERCOM_ACCESS_TOKEN,
  apiVersion: '2.11'
});
```

### Đồng Bộ Contacts Và Conversations

```javascript
// Full sync contacts và dữ liệu conversation
await tajo.connectors.sync('intercom', {
  type: 'full',
  resources: ['contacts', 'conversations', 'companies'],
  since: '2023-01-01'
});

// Kiểm tra trạng thái sync
const status = await tajo.connectors.status('intercom');
console.log(status);
// {
//   connected: true,
//   lastSync: '2024-01-15T10:30:00Z',
//   contactsSynced: 14200,
//   conversationsSynced: 28400,
//   companiesSynced: 2100
// }
```

### Xử Lý Intercom Webhooks

```javascript
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');
});
```

## Giới Hạn Tốc Độ

Intercom áp dụng giới hạn tốc độ dựa trên gói của bạn:

| Gói | Giới Hạn Tốc Độ | Chi Tiết |
| --- | --- | --- |
| Starter | 20 yêu cầu/10 giây | Mỗi app |
| Pro | 50 yêu cầu/10 giây | Mỗi app |
| Premium | 100 yêu cầu/10 giây | Mỗi app |
| Search endpoint | 1 yêu cầu/giây | Mỗi app |
| Scroll endpoint | 1 yêu cầu/phút | Mỗi app |

Giới hạn bổ sung:

- **Bulk operations**: 15 contacts mỗi bulk request
- **Event submissions**: 500 events/giây mỗi workspace
- **Webhook delivery**: Tự động retry trong 24 giờ
- **Data export**: 1 export đồng thời

Phản Hồi Giới Hạn Tốc Độ

Intercom trả về `429 Too Many Requests` với header `Retry-After`. Triển khai exponential backoff và tôn trọng cửa sổ retry.

## Khắc Phục Sự Cố

### Sự Cố Phổ Biến

| Sự Cố | Nguyên Nhân | Giải Pháp |
| --- | --- | --- |
| 401 Unauthorized | Token không hợp lệ hoặc hết hạn | Tạo lại access token trong Developer Hub |
| Contact không đồng bộ | Thiếu trường email | Intercom leads có thể thiếu email; lọc theo role |
| Dữ liệu conversation trống | App thiếu conversation scope | Ủy quyền lại với quyền đọc conversation |
| Webhook không nhận | Webhook chưa đăng ký | Cấu hình webhooks trong Developer Hub settings |
| API version không khớp | Breaking changes trong version mới | Ghim API version với header `Intercom-Version` |

### Chế Độ Debug

Bật verbose logging:

```yaml
connectors:
  intercom:
    debug: true
    log_level: verbose
    log_webhooks: true
```

### Kiểm Tra Kết Nối

```bash
tajo connectors test intercom
# ✓ API connection successful
# ✓ Contacts readable
# ✓ Conversations readable
# ✓ Companies readable
# ✓ Webhooks registered
```

## Thực Hành Tốt Nhất

1. **Ghim API version** - Luôn chỉ định `Intercom-Version` để tránh breaking changes
2. **Dùng search API hiệu quả** - Dùng filters và pagination để giảm data transfer
3. **Đồng bộ cả users và leads** - Capture toàn bộ funnel trong Brevo
4. **Ánh xạ conversation tags** - Dùng conversation tags cho post-support marketing segments
5. **Theo dõi custom events** - Gửi key product events sang Intercom để behavioral targeting
6. **Xử lý contact merges** - Triển khai merge logic cho contacts trùng lặp

## Bảo Mật

- **Access Token** - Xác thực bearer token cho private apps
- **OAuth 2.0** - Ủy quyền delegated cho public apps với client secret
- **Xác minh Webhook** - Xác thực chữ ký HMAC SHA-1 qua `X-Hub-Signature`
- **Mã hóa TLS** - Tất cả giao tiếp API được mã hóa qua HTTPS
- **Kiểm soát truy cập dữ liệu** - Truy cập dữ liệu chi tiết theo cấu hình app

## Tài Nguyên Liên Quan

- [Tài Liệu Developer Intercom](https://developers.intercom.com/docs)
- [Tham Khảo API Intercom](https://developers.intercom.com/docs/references/introduction)
- [Trình Kết Nối Zendesk](https://tajo.io/vi/docs/connectors/support/zendesk)
- [Customer Sync Skill](https://tajo.io/vi/docs/skills/data-sync/customer-sync)
- [Brevo Contacts API](https://tajo.io/vi/docs/contact-management)
