Trình Kết Nối Notion

Kết nối Notion với Brevo qua Tajo để đồng bộ database records sang liên hệ, kích hoạt chiến dịch từ cập nhật Notion và sử dụng Notion làm nguồn dữ liệu marketing.

Tổng Quan

Thuộc TínhGiá Trị
Nền TảngNotion
Danh MụcTùy Chỉnh
Độ Phức Tạp Thiết LậpDễ
Tích Hợp Chính ThứcKhông
Dữ Liệu Đồng BộDatabases, Pages, Blocks
Loại APIREST API
Xác ThựcInternal Integration Token

Tính Năng

  • Đồng bộ database - Ánh xạ Notion database properties sang thuộc tính liên hệ Brevo
  • Theo dõi thay đổi page - Forward updates Notion sang Brevo để kích hoạt chiến dịch
  • Quan hệ liên kết - Giải quyết relation properties để làm phong phú dữ liệu liên hệ
  • Lọc và sắp xếp - Đồng bộ chỉ database entries đáp ứng tiêu chí cụ thể
  • Nhiều database - Kết nối nhiều Notion databases trong một tích hợp

Yêu Cầu

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

  1. Tài khoản Notion (Free, Plus, Business, hoặc Enterprise)
  2. Notion Integration được tạo trong workspace
  3. Databases được chia sẻ với integration
  4. Tài khoản Brevo với quyền truy cập API
  5. Tài khoản Tajo

Xác Thực

Internal Integration Token

Terminal window
curl "https://api.notion.com/v1/databases/{database_id}" \
-H "Authorization: Bearer YOUR_INTEGRATION_TOKEN" \
-H "Notion-Version: 2022-06-28" \
-H "Content-Type: application/json"

Tạo integrations tại https://www.notion.so/my-integrations.

Yêu Cầu Chia Sẻ Page

Integration chỉ có thể truy cập databases và pages đã được chia sẻ rõ ràng với nó. Vào database settings > Connections > thêm integration của bạn.

Kết Nối với Tajo

Terminal window
tajo connectors install notion \
--integration-token $NOTION_INTEGRATION_TOKEN

Cấu Hình

Thiết Lập Cơ Bản

connectors:
notion:
enabled: true
integration_token: "${NOTION_INTEGRATION_TOKEN}"
# Các databases để đồng bộ
databases:
- id: "database_id_here"
name: "CRM Contacts"
sync_to: brevo_contacts
- id: "another_database_id"
name: "Newsletter Subscribers"
sync_to: brevo_list_5

Ánh Xạ Trường

Ánh xạ loại Notion property sang thuộc tính Brevo:

field_mapping:
# Properties tiêu chuẩn
"Email": email
"Name": FULLNAME
"Phone": SMS
"Company": COMPANY_NAME
# Properties trạng thái/chọn lựa
"Status": LIFECYCLE_STAGE
"Plan": PLAN_TYPE
# Properties ngày tháng
"Created": SIGNUP_DATE
"Last Contact": LAST_CONTACT_DATE

API Endpoints

Phương ThứcEndpointMô Tả
POST/v1/databases/{id}/queryTruy vấn database entries
GET/v1/pages/{id}Lấy chi tiết page
PATCH/v1/pages/{id}Cập nhật page properties
POST/v1/pagesTạo page mới
GET/v1/databases/{id}Lấy schema database
POST/v1/searchTìm kiếm pages và databases

Ví Dụ Code

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

import { TajoClient } from '@tajo/sdk';
const tajo = new TajoClient({
apiKey: process.env.TAJO_API_KEY,
brevoApiKey: process.env.BREVO_API_KEY
});
await tajo.connectors.connect('notion', {
integrationToken: process.env.NOTION_INTEGRATION_TOKEN
});

Đồng Bộ Database Sang Brevo

// Đồng bộ Notion database sang liên hệ Brevo
await tajo.connectors.sync('notion', {
databaseId: 'database_id_here',
type: 'incremental',
filter: {
property: 'Status',
select: { equals: 'Active' }
}
});

Phân Trang Cursor

Notion API sử dụng cursor-based pagination. Tajo tự động xử lý phân trang và lưu trữ cursor giữa các lần đồng bộ để xử lý tăng dần hiệu quả.

Giới Hạn Tốc Độ

Giới HạnGiá Trị
Yêu cầu API3 yêu cầu/giây
Kích thước trang tối đa100 kết quả

Khắc Phục Sự Cố

Sự CốNguyên NhânGiải Pháp
401 UnauthorizedToken không hợp lệXác minh integration token
Database không tìm thấyChưa chia sẻ với integrationThêm integration vào database connections
Property bị thiếuTên property không khớpKiểm tra tên property chính xác (phân biệt hoa/thường)
Relation không giải quyếtRelation database không chia sẻChia sẻ tất cả related databases với integration

Tài Nguyên Liên Quan

Subscribe to updates

developer-docs

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

auto-detect
Trợ lý AI

Xin chào! Hãy hỏi tôi về tài liệu.