Zapier 连接器

通过 Tajo 将 Zapier 连接到 Brevo,将数千款第三方应用与您的营销自动化工作流桥接,实现整个技术栈的无代码数据流和事件驱动触发。

概览

属性
平台Zapier
类别自动化(自定义)
设置复杂度简单
官方集成
同步数据事件、联系人、工作流、触发器
认证方式API 密钥 / OAuth 2.0

功能

  • 多应用编排 - 通过 Zap 工作流将 6,000+ 款应用连接到 Brevo
  • Webhook 触发 - 从任何 Zapier 连接的应用接收实时事件
  • 联系人同步 - 在 Zapier 连接的平台和 Brevo 之间推送和拉取联系人
  • 事件转发 - 将应用事件通过 Tajo 路由到 Brevo 自动化
  • 多步骤 Zap - 使用过滤器、格式化器和延迟构建复杂工作流
  • 自定义 Zapier 应用 - 使用 Zapier Platform CLI 构建定制集成

前提条件

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

  1. Zapier 账户(免费版或以上)
  2. 具有 API 访问权限的 Brevo 账户
  3. 具有连接器权限的 Tajo 账户
  4. 已安装 Node.js 18+(用于基于 CLI 的集成开发)

认证

API 密钥认证

Terminal window
# Set your Zapier Platform credentials
export ZAPIER_DEPLOY_KEY=your_deploy_key
export TAJO_API_KEY=your_tajo_api_key
export BREVO_API_KEY=your_brevo_api_key

OAuth 2.0

Zapier 支持 OAuth 2.0 用于在 Zap 中连接第三方服务:

const authentication = {
type: 'oauth2',
oauth2Config: {
authorizeUrl: {
url: 'https://your-app.com/oauth/authorize',
params: {
client_id: '{{process.env.CLIENT_ID}}',
state: '{{bundle.inputData.state}}',
redirect_uri: '{{bundle.inputData.redirect_uri}}',
response_type: 'code'
}
},
getAccessToken: {
url: 'https://your-app.com/oauth/token',
method: 'POST',
body: {
code: '{{bundle.inputData.code}}',
client_id: '{{process.env.CLIENT_ID}}',
client_secret: '{{process.env.CLIENT_SECRET}}',
grant_type: 'authorization_code',
redirect_uri: '{{bundle.inputData.redirect_uri}}'
}
},
refreshAccessToken: {
url: 'https://your-app.com/oauth/token',
method: 'POST',
body: {
refresh_token: '{{bundle.authData.refresh_token}}',
client_id: '{{process.env.CLIENT_ID}}',
client_secret: '{{process.env.CLIENT_SECRET}}',
grant_type: 'refresh_token'
}
}
}
};

配置

基础设置

connectors:
zapier:
enabled: true
webhook_url: "https://hooks.zapier.com/hooks/catch/YOUR_HOOK_ID"
sync:
contacts: true
events: true
workflows: true
triggers:
- contact_created
- order_placed
- form_submitted
mapping:
email: email
first_name: FIRSTNAME
last_name: LASTNAME

Webhook 配置

配置 Tajo 向 Zapier Webhook 发送事件:

webhooks:
zapier:
url: "https://hooks.zapier.com/hooks/catch/YOUR_HOOK_ID"
events:
- contact.created
- contact.updated
- order.completed
- cart.abandoned
retry:
max_attempts: 3
backoff: exponential

API 端点

端点方法描述
https://hooks.zapier.com/hooks/catch/{id}POSTWebhook 捕获钩子
https://nla.zapier.com/api/v1/dynamic/exposed/GET列出已暴露操作
https://nla.zapier.com/api/v1/dynamic/exposed/{action_id}/execute/POST执行操作
https://zapier.com/api/platform/cli/appsGET列出已注册应用
https://zapier.com/api/platform/cli/pushPOST部署集成

代码示例

初始化连接器

import { TajoClient } from '@tajo/sdk';
const tajo = new TajoClient({
apiKey: process.env.TAJO_API_KEY,
brevoApiKey: process.env.BREVO_API_KEY
});
// Connect Zapier via webhook
await tajo.connectors.connect('zapier', {
webhookUrl: process.env.ZAPIER_WEBHOOK_URL,
events: ['contact.created', 'order.completed']
});

使用 Platform CLI 构建自定义 Zapier 集成

const { version: platformVersion } = require('zapier-platform-core');
const App = {
version: require('./package.json').version,
platformVersion,
authentication,
triggers: {
new_contact: {
key: 'new_contact',
noun: 'Contact',
display: {
label: 'New Contact in Tajo',
description: 'Triggers when a new contact is synced.'
},
operation: {
perform: async (z, bundle) => {
const response = await z.request({
url: 'https://api.tajo.io/v1/contacts',
params: { since: bundle.meta.lastPoll }
});
return response.data;
}
}
}
},
creates: {
sync_contact: {
key: 'sync_contact',
noun: 'Contact',
display: {
label: 'Sync Contact to Brevo',
description: 'Syncs a contact to Brevo via Tajo.'
},
operation: {
inputFields: [
{ key: 'email', required: true, type: 'string' },
{ key: 'firstName', type: 'string' },
{ key: 'lastName', type: 'string' }
],
perform: async (z, bundle) => {
const response = await z.request({
method: 'POST',
url: 'https://api.tajo.io/v1/contacts/sync',
body: bundle.inputData
});
return response.data;
}
}
}
}
};
module.exports = App;

处理传入的 Zapier Webhook

app.post('/webhooks/zapier', async (req, res) => {
const { event, data } = req.body;
await tajo.connectors.handleWebhook('zapier', {
topic: event,
payload: data
});
res.status(200).json({ status: 'received' });
});

速率限制

套餐请求任务/月轮询间隔
免费100/天10015 分钟
入门1,000/天75015 分钟
专业5,000/天2,0002 分钟
团队10,000/天50,0001 分钟

Zapier 任务限制

每个 Zap 步骤计为一个任务。多步骤 Zap 每次执行消耗多个任务。在 Zapier 控制台中监控您的任务使用情况以避免超额。

故障排除

问题原因解决方案
Webhook 未触发Zap 已关闭在 Zapier 控制台中检查 Zap 状态
数据未映射字段名称不匹配验证应用之间的字段键一致
重复联系人未配置去重在 Tajo 中启用基于邮箱的去重
Zap 错误API 速率限制达到添加延迟步骤或升级 Zapier 套餐
认证过期令牌未刷新在 Zapier 中重新认证连接

调试模式

connectors:
zapier:
debug: true
log_level: verbose
log_webhooks: true

最佳实践

  1. 使用 Webhook 而非轮询 - Webhook 提供实时数据流,轮询存在延迟
  2. 添加错误处理 - 使用 Zapier Paths 处理成功/失败场景
  3. 去重数据 - 启用去重键以防止重复记录
  4. 监控任务用量 - 在达到任务限制前设置提醒
  5. 合理使用过滤器 - 在 Zap 早期过滤以减少不必要的任务消耗
  6. 版本化 CLI 集成 - 为 Platform CLI 应用使用语义化版本控制

安全

  • 仅 HTTPS - 所有 Webhook URL 必须使用 HTTPS
  • API 密钥轮换 - 定期通过 Zapier 控制台轮换密钥
  • OAuth 2.0 - 第三方服务认证使用 OAuth
  • Webhook 验证 - 验证传入的 Webhook 签名
  • 范围权限 - 每个 Zap 授予最低所需访问权限

相关资源

Subscribe to updates

developer-docs

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

auto-detect
AI 助手

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