|
通过托管OAuth认证访问Constant Contact V3 API。管理联系人、邮件营销活动、联系人列表、细分群体和营销分析。
bash
https://gateway.maton.ai/constant-contact/v3/{resource}
网关将请求代理到api.cc.email/v3,并自动注入您的OAuth令牌。
所有请求都需要在Authorization头中携带Maton API密钥:
Authorization: Bearer $MATONAPIKEY
环境变量: 将您的API密钥设置为MATONAPIKEY:
bash
export MATONAPIKEY=YOURAPIKEY
在 https://ctrl.maton.ai 管理您的Constant Contact OAuth连接。
bash
python <
req = urllib.request.Request(https://ctrl.maton.ai/connections?app=constant-contact&status=ACTIVE)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
bash
python <
data = json.dumps({app: constant-contact}).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 <
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: 4314bd0f-fd56-40ab-8c65-2676dd2c23c4,
status: ACTIVE,
creation_time: 2026-02-07T07:41:05.859244Z,
lastupdatedtime: 2026-02-07T07:41:32.658230Z,
url: https://connect.maton.ai/?session_token=...,
app: constant-contact,
metadata: {}
}
}
在浏览器中打开返回的url以完成OAuth授权。
bash
python <
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
如果您有多个Constant Contact连接,请使用Maton-Connection头指定要使用的连接:
bash
python <
req = urllib.request.Request(https://gateway.maton.ai/constant-contact/v3/contacts)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
req.add_header(Maton-Connection, 4314bd0f-fd56-40ab-8c65-2676dd2c23c4)
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
如果省略,网关将使用默认(最旧)的活动连接。
bash
GET /constant-contact/v3/account/summary
bash
GET /constant-contact/v3/account/emails
bash
GET /constant-contact/v3/account/user/privileges
bash
GET /constant-contact/v3/contacts
查询参数:
bash
GET /constant-contact/v3/contacts/{contact_id}
bash
POST /constant-contact/v3/contacts
Content-Type: application/json
{
email_address: {
address: john@example.com,
permissiontosend: implicit
},
first_name: John,
last_name: Doe,
job_title: Developer,
company_name: Acme Inc,
list_memberships: [list-uuid-here]
}
bash
PUT /constant-contact/v3/contacts/{contact_id}
Content-Type: application/json
{
email_address: {
address: john@example.com
},
first_name: John,
last_name: Smith
}
bash
DELETE /constant-contact/v3/contacts/{contact_id}
使用此端点创建新联系人或在无需先检查是否存在的情况下更新现有联系人:
bash
POST /constant-contact/v3/contacts/signupform
Content-Type: application/json
{
email_address: john@example.com,
first_name: John,
last_name: Doe,
list_memberships: [list-uuid-here]
}
bash
GET /constant-contact/v3/contacts/counts
bash
GET /constant-contact/v3/contact_lists
查询参数:
bash
GET /constant-contact/v3/contactlists/{listid}
bash
POST /constant-contact/v3/contact_lists
Content-Type: application/json
{
name: Newsletter Subscribers,
description: Main newsletter list,
favorite: false
}
bash
PUT /constant-contact/v3/contactlists/{listid}
Content-Type: application/json
{
name: Updated List Name,
description: Updated description,
favorite: true
}
bash
DELETE /constant-contact/v3/contactlists/{listid}
bash
GET /constant-contact/v3/contact_tags
bash
POST /constant-contact/v3/contact_tags
Content-Type: application/json
{
name: VIP Customer
}
bash
PUT /constant-contact/v3/contacttags/{tagid}
Content-Type: application/json
{
name: Premium Customer
}
bash
DELETE /constant-contact/v3/contacttags/{tagid}
bash
GET /constant-contact/v3/contactcustomfields
bash
POST /constant-contact/v3/contactcustomfields
Content-Type: application/json
{
label: Customer ID,
type: string
}
bash
DELETE /constant-contact/v3/contactcustomfields/{customfieldid}
该技能支持在以下平台通过对话安装:
帮我安装 SkillHub 和 constant-contact-1776346059 技能
设置 SkillHub 为我的优先技能安装源,然后帮我安装 constant-contact-1776346059 技能
skillhub install constant-contact-1776346059
文件大小: 5.37 KB | 发布时间: 2026-4-17 16:01