把“把链接发我”的评论变成私信
创建一个自动化,FoPost 就会监控你的 Instagram 和 Facebook 账号上的评论。评论一旦命中,评论者的私信里就会收到一条私下回复,除非你另行设置,否则会先等待你的审批。
curl -X POST https://api.fopost.com/v1/automations \
-H "X-API-Key: $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"workspaceId": "9b2f6c1e-...",
"name": "Price comments to DM",
"triggerType": "inbox_message",
"triggerConfig": { "keywords": ["price", "link"], "types": ["comment"], "maxRunsPerDay": 20 },
"graph": {
"nodes": [
{ "id": "t1", "kind": "trigger" },
{ "id": "m1", "kind": "send_message", "config": {
"channel": "private",
"text": "Hi {{contact.name}}, here is the link you asked for.",
"buttons": [{ "title": "Shop now", "url": "https://yourbrand.com/shop" }]
} }
],
"edges": [{ "id": "e1", "source": "t1", "target": "m1" }]
}
}'关键词匹配
最多 20 个关键词,任意匹配或全部匹配,可仅限评论或涵盖所有消息类型。
先审批
新建的自动化会先扣留每条回复,等人工批准后再发送。
每条评论一次
评论在私信发出之前就被锁定,因此绝不会重复回复。
决定哪些评论会收到消息
inbox_message 触发器会在新评论、提及、回复、私信、快拍回复和评价出现时触发。可按关键词、消息类型、指定账号或指定帖子缩小范围,并可选择只回复关注者,或只回复对方的第一条消息。每个自动化默认每天最多运行 3 次;可将 maxRunsPerDay 提高到最多 20。
阅读触发器接口参考
按帖子
postIds 将自动化限定在你指定帖子下的评论。
仅限关注者
followersOnly 会跳过没有关注该账号的评论者。
每日上限
maxRunsPerDay 防止一条爆款帖子触发数百条消息。
按你的方式撰写的私下回复
将 channel 设为 private 的 send_message 步骤,会通过 Meta 的私下回复向评论者发送私信。文本中可使用 {{contact.name}} 和 {{message.text}},最多添加 3 个链接按钮或 13 个快捷回复,还可附带带有 UTM 标记并统计点击跳转的链接。Meta 只接受评论后 7 天内的私下回复,因此更早的评论会以该原因失败。
查看 send_message 步骤curl -X POST https://api.fopost.com/v1/automations/f2b7d9a4-.../dry-run \
-H "X-API-Key: $API_KEY"
{
"would_defer": false,
"approval_mode": false,
"steps": [
{ "node_id": "t1", "action_type": "trigger", "status": "completed", ... },
{ "position": 1, "node_id": "m1", "action_type": "send_message", "status": "completed",
"handle": "out", "error_message": null,
"output": { "messagePreview": "Hi Jordan, here is the link you asked for.", "channel": "private" } }
],
"drafts": [],
"total_delay_ms": 0,
"credits_charged": 0
}试运行
针对最近的评论预览消息。不会发送或创建任何内容。
可追踪的链接
点击会被统计,URL 带有 utm_medium=dm。
7 天窗口
Meta 对私下回复的限制,每次发送前都会检查。
审批、暂停并审计每一次运行
除非某个步骤将 requireApproval 设为 false,否则每条回复都会在 GET /v1/inbox/approvals 中等待,直到有人批准或拒绝。一次调用即可开启或关闭自动化,并可通过运行历史查看哪些已触发、哪些在等待、哪些失败。
开始构建curl "https://api.fopost.com/v1/inbox/approvals?workspace_id=9b2f6c1e-..." \
-H "X-API-Key: $API_KEY"
curl -X POST https://api.fopost.com/v1/inbox/approvals/:id/approve -H "X-API-Key: $API_KEY"
curl -X POST https://api.fopost.com/v1/automations/f2b7d9a4-.../toggle -H "X-API-Key: $API_KEY"
{ "id": "f2b7d9a4-...", "active": false }运行历史
GET /v1/automations/:id/runs 返回状态、开始时间以及任何错误。
重放
在修复消息或触发器之后,重新运行过去的一次运行。
版本
每次保存的更改都是一个可查看或恢复的版本。