返回顶部
k

klaviyoKlaviyo平台

|

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.4
安全检测
已通过
15,751
下载量
免费
免费
9
收藏
概述
安装方式
版本历史

klaviyo

Klaviyo

通过托管OAuth认证访问Klaviyo API。管理用于电子邮件营销和客户互动的用户档案、列表、细分、营销活动、流程、事件、指标、模板、目录和Webhook。

快速开始

bash

列出用户档案


python < import urllib.request, os, json
req = urllib.request.Request(https://gateway.maton.ai/klaviyo/api/profiles)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
req.add_header(revision, 2026-01-15)
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

基础URL

https://gateway.maton.ai/klaviyo/{native-api-path}

将{native-api-path}替换为实际的Klaviyo API端点路径。网关将请求代理到a.klaviyo.com并自动注入您的OAuth令牌。

认证

所有请求都需要在Authorization头中包含Maton API密钥:

Authorization: Bearer $MATONAPIKEY

环境变量: 将您的API密钥设置为MATONAPIKEY:

bash
export MATONAPIKEY=YOURAPIKEY

获取您的API密钥

  1. 1. 在maton.ai登录或创建账户
  2. 前往maton.ai/settings
  3. 复制您的API密钥

API版本管理

Klaviyo使用基于日期的API版本管理。在所有请求中包含revision头:

revision: 2026-01-15

连接管理

在https://ctrl.maton.ai管理您的Klaviyo OAuth连接。

列出连接

bash
python < import urllib.request, os, json
req = urllib.request.Request(https://ctrl.maton.ai/connections?app=klaviyo&status=ACTIVE)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

创建连接

bash
python < import urllib.request, os, json
data = json.dumps({app: klaviyo}).encode()
req = urllib.request.Request(https://ctrl.maton.ai/connections, data=data, method=POST)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
req.add_header(Content-Type, application/json)
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

获取连接

bash
python < import urllib.request, os, json
req = urllib.request.Request(https://ctrl.maton.ai/connections/{connection_id})
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

响应:
json
{
connection: {
connection_id: 21fd90f9-5935-43cd-b6c8-bde9d915ca80,
status: ACTIVE,
creation_time: 2025-12-08T07:20:53.488460Z,
lastupdatedtime: 2026-01-31T20:03:32.593153Z,
url: https://connect.maton.ai/?session_token=...,
app: klaviyo,
metadata: {}
}
}

在浏览器中打开返回的url以完成OAuth授权。

删除连接

bash
python < import urllib.request, os, json
req = urllib.request.Request(https://ctrl.maton.ai/connections/{connection_id}, method=DELETE)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

指定连接

如果您有多个Klaviyo连接,请使用Maton-Connection头指定要使用的连接:

bash
python < import urllib.request, os, json
req = urllib.request.Request(https://gateway.maton.ai/klaviyo/api/profiles)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
req.add_header(revision, 2026-01-15)
req.add_header(Maton-Connection, 21fd90f9-5935-43cd-b6c8-bde9d915ca80)
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

如果省略,网关将使用默认(最旧的)活动连接。

API参考

用户档案

管理客户数据和同意。

获取用户档案

bash
GET /klaviyo/api/profiles

查询参数:

  • - filter - 筛选用户档案(例如:filter=equals(email,test@example.com))
  • fields[profile] - 要包含的字段列表,用逗号分隔
  • page[cursor] - 分页游标
  • page[size] - 每页结果数(最多100)
  • sort - 排序字段(前缀-表示降序)

示例:

bash
python < import urllib.request, os, json
req = urllib.request.Request(https://gateway.maton.ai/klaviyo/api/profiles?fields[profile]=email,firstname,lastname&page[size]=10)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
req.add_header(revision, 2026-01-15)
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

响应:
json
{
data: [
{
type: profile,
id: 01GDDKASAP8TKDDA2GRZDSVP4H,
attributes: {
email: alice@example.com,
first_name: Alice,
last_name: Johnson
}
}
],
links: {
self: https://a.klaviyo.com/api/profiles,
next: https://a.klaviyo.com/api/profiles?page[cursor]=...
}
}

获取单个用户档案

bash
GET /klaviyo/api/profiles/{profile_id}

示例:

bash
python < import urllib.request, os, json
req = urllib.request.Request(https://gateway.maton.ai/klaviyo/api/profiles/01GDDKASAP8TKDDA2GRZDSVP4H)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
req.add_header(revision, 2026-01-15)
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

创建用户档案

bash
POST /klaviyo/api/profiles
Content-Type: application/json

{
data: {
type: profile,
attributes: {
email: newuser@example.com,
first_name: John,
last_name: Doe,
phone_number: +15551234567,
properties: {
custom_field: value
}
}
}
}

示例:

bash
python < import urllib.request, os, json
data = json.dumps({data: {type: profile, attributes: {email: newuser@example.com, firstname: John, lastname: Doe}}}).encode()
req = urllib.request.Request(https://gateway.maton.ai/klaviyo/api/profiles, data=data, method=POST)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
req.add_header(Content-Type, application/json)
req.add_header(revision, 2026-01-15)
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

更新用户档案

bash
PATCH /klaviyo/api/profiles/{profile_id}

示例:

bash
python < import urllib.request, os, json
data = json.dumps({data: {type: profile, id: 01GDDKASAP8TKDDA2GRZDSVP4H, attributes: {first_name: Jane}}}).encode()
req = urllib.request.Request(https://gateway.maton.ai/klaviyo/api/profiles/01GDD

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 klaviyo-1776363008 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 klaviyo-1776363008 技能

通过命令行安装

skillhub install klaviyo-1776363008

下载

⬇ 下载 klaviyo v1.0.4(免费)

文件大小: 7.88 KB | 发布时间: 2026-4-17 14:37

v1.0.4 最新 2026-4-17 14:37
- Updated all examples and documentation references to use the new Klaviyo API revision date header: 2026-01-15 (was 2024-10-15).
- No functional changes detected; this update is documentation-only.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部