---
title: "Gorgias 连接器"
description: "完整的 Gorgias 集成指南，通过 Tajo 将服务台工单、客户数据和支持事件与 Brevo 同步。"
url: https://tajo.io/zh-cn/docs/connectors/support/gorgias/
markdown: https://tajo.io/zh-cn/docs/connectors/support/gorgias.md
lang: zh-CN
robots: noindex
---

申请抢先体验

请输入您的名字和公司电子邮箱地址。我们会发送确认 Tajo 访问申请的链接。

# Gorgias 连接器

连接器状态: 计划中 尚未构建。Tajo 目前不运行此连接器。

| 来源字段 | 目标字段 | 示例值 |
| --- | --- | --- |
| `record.id` | `source_id` | `record_1042` |
| `record.updated_at` | `updated_at` | `2026-10-18T08:00:00Z` |
| `record.value` | `value` | `sample_value` |

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

## 概览

| 属性 | 值 |
| --- | --- |
| **平台** | Gorgias |
| **类别** | 支持 |
| **设置复杂度** | 简单 |
| **官方集成** | 否 |
| **同步数据** | 客户、工单、事件 |
| **API 类型** | REST API |
| **认证方式** | API 密钥 + 邮箱（基本认证） |
| **基础 URL** | `https://{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/`

```bash
# Basic Auth: email as username, API key as password
curl -X GET "https://yourstore.gorgias.com/api/customers" \
  -u "admin@yourstore.com:$GORGIAS_API_KEY" \
  -H "Content-Type: application/json"
```

API 密钥权限

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

### 连接到 Tajo

```bash
tajo connectors install gorgias \
  --domain yourstore.gorgias.com \
  --email admin@yourstore.com \
  --api-key $GORGIAS_API_KEY
```

## 配置

### 基础设置

```yaml
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 联系人属性：

```yaml
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
```

### 事件映射

```yaml
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/customers` | GET | 列出客户 |
| `/api/customers/{id}` | GET | 检索客户 |
| `/api/customers` | POST | 创建客户 |
| `/api/customers/{id}` | PUT | 更新客户 |
| `/api/tickets` | GET | 列出工单 |
| `/api/tickets/{id}` | GET | 检索工单 |
| `/api/tickets/{id}/messages` | GET | 列出工单消息 |
| `/api/tags` | GET | 列出标签 |
| `/api/satisfaction-surveys` | GET | 列出 CSAT 调查 |
| `/api/satisfaction-surveys/{id}` | GET | 检索调查 |
| `/api/users` | GET | 列出客服 |
| `/api/integrations` | GET | 列出集成 |
| `/api/events` | GET | 列出事件 |
| `/api/customers/{id}/custom-fields` | GET | 获取自定义字段值 |

## 代码示例

### 初始化连接器

```javascript
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',
  email: 'admin@yourstore.com',
  apiKey: process.env.GORGIAS_API_KEY
});
```

### 将客户同步到 Brevo

```javascript
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 集成处理工单事件

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

### 工单解决后营销活动

```javascript
// 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 数据

```javascript
// 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 使用带 `cursor` 和 `limit` 参数的游标分页。Tajo 自动处理此问题，每页最多请求 100 条以获得最大效率。

超出速率限制时，Gorgias 返回 `429 Too Many Requests`。

## 故障排除

### 常见问题

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

### 调试模式

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

### 测试连接

```bash
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 认证

## 相关资源

- [Twilio Flex 连接器](https://tajo.io/zh-cn/docs/connectors/custom/twilio-flex)
- [Jira 连接器](https://tajo.io/zh-cn/docs/connectors/custom/jira)
- [Shopify 连接器](https://tajo.io/zh-cn/docs/connectors/ecommerce/shopify)
- [Brevo 联系人 API](https://tajo.io/zh-cn/docs/contact-management)
