Gorgias 连接器

通过 Tajo 将您的 Gorgias 服务台连接到 Brevo,实现支持驱动的客户参与、工单后营销流程和统一的客户体验分析。

概览

属性
平台Gorgias
类别支持
设置复杂度简单
官方集成
同步数据客户、工单、事件
API 类型REST API
认证方式API 密钥 + 邮箱(基本认证)
基础 URLhttps://{domain}.gorgias.com/api/

功能

  • 工单事件同步 - 将工单创建、解决和 CSAT 事件转发到 Brevo 时间线
  • 客户档案丰富 - 将包含标签和自定义字段的 Gorgias 客户数据同步到 Brevo
  • 支持后营销活动 - 工单解决后触发 Brevo 工作流,用于跟进或追加销售
  • 满意度跟踪 - 将 CSAT 调查结果同步为 Brevo 联系人属性
  • 基于标签的细分 - 将 Gorgias 客户标签映射为 Brevo 列表会员资格
  • 宏和规则事件 - 跟踪自动化操作用于运营分析

前提条件

开始之前,请确保您已具备:

  1. 具有管理员访问权限的 Gorgias 账户
  2. 您的 Gorgias 子域名(例如 yourstore.gorgias.com
  3. API 密钥和关联的邮箱地址
  4. 具有 API 访问权限的 Brevo 账户
  5. 具有有效订阅的 Tajo 账户

认证

Gorgias 使用您的账户邮箱和 API 密钥进行 HTTP 基本认证。

创建 API 密钥

  1. 登录您的 Gorgias 仪表板
  2. 导航到设置 > REST API
  3. 点击创建 API 密钥(或复制现有密钥)
  4. 记录您的 API 基础 URL:https://{domain}.gorgias.com/api/
Terminal window
# Basic Auth: email as username, API key as password
curl -X GET "https://yourstore.gorgias.com/api/customers" \
-u "[email protected]:$GORGIAS_API_KEY" \
-H "Content-Type: application/json"

API 密钥权限

Gorgias API 密钥对您的账户数据拥有完全访问权限。没有基于范围的权限模型。请保护好您的 API 密钥并定期轮换。

连接到 Tajo

Terminal window
tajo connectors install gorgias \
--domain yourstore.gorgias.com \
--api-key $GORGIAS_API_KEY

配置

基础设置

connectors:
gorgias:
enabled: true
domain: "yourstore.gorgias.com"
sync:
customers: true
tickets: true
satisfaction_surveys: true
tags: true
lists:
all_support_contacts: 35
satisfied_customers: 36
dissatisfied_customers: 37

字段映射

将 Gorgias 客户和工单字段映射到 Brevo 联系人属性:

field_mapping:
# Customer fields
id: GORGIAS_ID
email: email
name: FIRSTNAME
phone: SMS
# Support metrics
nb_tickets: TICKET_COUNT
last_ticket_date: LAST_SUPPORT_DATE
last_ticket_channel: LAST_SUPPORT_CHANNEL
avg_response_time: AVG_RESPONSE_TIME
# CSAT data
last_satisfaction_score: CSAT_SCORE
satisfaction_count: CSAT_RESPONSES
# Custom fields
customer_type: CUSTOMER_TYPE
vip_status: VIP_STATUS

事件映射

event_mapping:
ticket.created: SUPPORT_TICKET_OPENED
ticket.closed: SUPPORT_TICKET_RESOLVED
ticket.reopened: SUPPORT_TICKET_REOPENED
satisfaction_survey.created: CSAT_SURVEY_SENT
satisfaction_survey.responded: CSAT_SUBMITTED
customer.created: SUPPORT_CUSTOMER_CREATED

API 端点

Tajo 集成以下 Gorgias REST API 端点:

端点方法用途
/api/customersGET列出客户
/api/customers/{id}GET检索客户
/api/customersPOST创建客户
/api/customers/{id}PUT更新客户
/api/ticketsGET列出工单
/api/tickets/{id}GET检索工单
/api/tickets/{id}/messagesGET列出工单消息
/api/tagsGET列出标签
/api/satisfaction-surveysGET列出 CSAT 调查
/api/satisfaction-surveys/{id}GET检索调查
/api/usersGET列出客服
/api/integrationsGET列出集成
/api/eventsGET列出事件
/api/customers/{id}/custom-fieldsGET获取自定义字段值

代码示例

初始化连接器

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('gorgias', {
domain: 'yourstore.gorgias.com',
apiKey: process.env.GORGIAS_API_KEY
});

将客户同步到 Brevo

await tajo.connectors.sync('gorgias', {
type: 'incremental',
resources: ['customers'],
since: '2024-01-01',
batchSize: 30
});
const status = await tajo.connectors.status('gorgias');
console.log(status);
// {
// connected: true,
// lastSync: '2024-03-15T17:00:00Z',
// customersCount: 14200,
// ticketsTracked: 28600,
// csatResponses: 3400
// }

通过 HTTP 集成处理工单事件

// Gorgias can send HTTP requests via Rules or HTTP integrations
app.post('/webhooks/gorgias', async (req, res) => {
const event = req.body;
await tajo.connectors.handleEvent('gorgias', {
type: 'ticket.updated',
payload: {
ticketId: event.ticket_id,
status: event.status,
customerEmail: event.customer?.email,
channel: event.channel,
tags: event.tags,
satisfaction: event.satisfaction
}
});
res.status(200).send('OK');
});

工单解决后营销活动

// Trigger a follow-up email after a support ticket is resolved
tajo.connectors.on('gorgias', 'ticket.closed', async (event) => {
if (event.satisfaction_score >= 4) {
await tajo.campaigns.trigger('post-support-upsell', {
email: event.customer.email,
params: {
agent_name: event.assignee.name,
ticket_subject: event.subject,
resolution_time: event.resolution_time
}
});
}
});

同步 CSAT 数据

// Sync satisfaction survey results to Brevo attributes
await tajo.connectors.sync('gorgias', {
type: 'incremental',
resources: ['satisfaction_surveys'],
since: '2024-01-01'
});

速率限制

Gorgias 按账户实施速率限制:

限制类型
API 速率限制2 请求/秒
突发允许量短时间内最多 5 个请求
分页每页 30 条(默认),最多 100 条

分页策略

Gorgias 使用带 cursorlimit 参数的游标分页。Tajo 自动处理此问题,每页最多请求 100 条以获得最大效率。

超出速率限制时,Gorgias 返回 429 Too Many Requests

故障排除

常见问题

问题原因解决方案
401 Unauthorized邮箱或 API 密钥无效在 Gorgias 设置 > REST API 中验证凭据
404 Not Found端点或资源 ID 无效检查 API 基础 URL 是否包含您的子域名
客户缺失记录中无邮箱Gorgias 需要邮箱进行客户匹配
标签未同步标签未分配给客户验证标签是在客户对象上,而非仅在工单上
同步缓慢速率限制低Gorgias 限制 2 请求/秒;完整同步需要更长时间

调试模式

connectors:
gorgias:
debug: true
log_level: verbose
log_api_calls: true

测试连接

Terminal window
tajo connectors test gorgias
# ✓ API authentication successful
# ✓ Customer list accessible
# ✓ Ticket data readable
# ✓ CSAT surveys available
# ✓ Tags listable

最佳实践

  1. 使用 HTTP 集成实现实时性 - 配置 Gorgias 规则,在工单事件时向 Tajo 发送 HTTP 请求
  2. 定期同步 CSAT 数据 - 使用满意度评分推动重参与活动
  3. 将标签映射到细分 - 将 Gorgias 客户标签转换为 Brevo 列表会员资格
  4. 谨慎处理分页 - 2 请求/秒的限制下,大型数据集同步时间较长
  5. 关联电子商务数据 - 在 Brevo 中将 Gorgias 支持数据与 Shopify 订单数据结合
  6. 轮换 API 密钥 - 由于 Gorgias 密钥拥有完整访问权限,请定期轮换

安全

  • 基本认证 - 通过 HTTPS 的邮箱和 API 密钥
  • 仅 HTTPS - 所有 API 通信通过 TLS 1.2+ 加密
  • 完全访问密钥 - 无细粒度范围(请妥善保护密钥)
  • IP 白名单 - 较高 Gorgias 计划可用
  • 加密存储 - API 凭据在 Tajo 中静态加密
  • SOC 2 合规 - Gorgias 平台通过 SOC 2 Type II 认证

相关资源

Subscribe to updates

developer-docs

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

auto-detect
AI 助手

你好!关于文档有任何问题都可以问我。