在取得同意的前提下匯入聯絡人、建立行銷範本、發送給同意接收的人、依號碼追蹤結果,並跟進已回覆或已點擊的人。
您匯入客戶清單,Meta 核准一個行銷範本,然後每一批只需一次 API 呼叫就能發送。每位客戶都會收到來自您企業名稱的 WhatsApp 訊息:「John 您好,我們的冬季特賣今天開始:全館商品折扣 20%,到週日為止。」如果他們不想再收到優惠,只要回覆 STOP,就再也不會收到。
app2email 只會發送給可以收到的人。Do Not Call 名單上的號碼會被略過,而在開啟選擇加入規則時,沒有選擇加入記錄的人也會被略過。每個號碼的結果(已接受、已送達、已讀、已回覆、失敗、已略過)都可以透過 webhook 事件、API、CSV 檔案,以及活動記錄(Activity Log)中該群發的報告頁面取得。
GET /compliance/export.csv 會把這三者放進同一個檔案。403 whatsapp_payment_issue)。| 權限範圍 | 在本指南中的用途 |
|---|---|
contacts:manage | 匯入聯絡人、記錄同意、儲存分群(POST /contacts/import、POST /contacts/{identity}/consent、POST /segments) |
settings:manage | 開啟選擇加入規則並記錄選擇加入(PUT /settings/optin、POST /optins) |
dnc:manage | Do Not Call 名單(POST /donotcall、GET /donotcall)和合規匯出 |
templates:manage | 建立行銷範本(POST /templates) |
messages:send | 發送群發、取消群發、發送跟進訊息(POST /messages、POST /broadcasts/{code}/cancel、POST /broadcasts/{code}/retarget) |
messages:read | 範本狀態、分群聯絡人、群發結果、點擊、用量、號碼健康狀況 |
webhooks:manage | 新增接收事件的 webhook(POST /webhooks) |
預設金鑰(在金鑰有權限之前建立的)只有 messages:send、messages:read、dnc:manage 和 webhooks:manage。請建立一把具備上述權限範圍的金鑰,或具備完整存取(*)的金鑰。GET /v1/YOUR_NUMBER/me 會顯示您目前這把金鑰的權限範圍。
先試用。 在您自己號碼上的沙盒金鑰(在 API 金鑰頁面建立、帶有沙盒標記的金鑰)會真實檢查每一次發送,但不會向 WhatsApp 發送任何內容。回應帶有 "sandbox": true,訊息 id 以 wamid.SANDBOX. 開頭,message.status 事件仍會送達。
請注意:使用沙盒金鑰時,匯入聯絡人、儲存分群、選擇加入和 Do Not Call 名單都會改變您的真實資料。建立範本、PUT /settings/optin 和重新鎖定受眾(除非帶有 dry_run)會回應 403 sandbox_key。
完全不需要帳號時,POST https://api.app2email.com/v1/account/sandbox(不帶金鑰、不帶內容),或管理 MCP 伺服器的 create_sandbox 工具,會給您示範號碼 12025550100 的即時沙盒金鑰。它有 MARKETING 範本 weekend_offer,它的虛擬客戶 12025550104 會回覆 STOP:您會收到 contact.opted_out,之後再向他發送行銷範本會回應 403 recipient_opted_out。該金鑰只有少數幾個呼叫(GET /templates、POST /messages、GET /events 和其他幾個),所以本指南中的聯絡人和群發呼叫,需要您自己號碼上的金鑰。請參閱沙盒。
傳送一個含有標題列的 CSV 檔案。app2email 認得的欄位有 phone(或 identity、number、mobile)、name(或 first_name + last_name)、tags(以 | 分隔)、consent_marketing(yes 或 no)、consent_source、consent_text、consent_evidence、consent_at 和 source。其他每個欄位都會變成自訂欄位。號碼國碼在前,只用數字。每次呼叫最多 5000 列。
phone,name,first_name,tags,consent_marketing,consent_source,consent_text,consent_evidence,consent_at
61412345678,John Smith,John,vip|newsletter,yes,web form,"Yes, send me offers on WhatsApp",https://example.com/forms/123,2026-10-01T09:00:00Z
61498765432,Mary Jones,Mary,newsletter,yes,checkout,"Yes, send me offers on WhatsApp",order 5521,2026-10-12T02:30:00Zcurl -s https://api.app2email.com/v1/YOUR_NUMBER/contacts/import \
-H "Authorization: Bearer $A2E_KEY" \
-H "Content-Type: text/csv" \
--data-binary @contacts.csvimport { readFile } from "node:fs/promises";
const res = await fetch("https://api.app2email.com/v1/YOUR_NUMBER/contacts/import", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.A2E_KEY}`,
"Content-Type": "text/csv",
},
body: await readFile("contacts.csv"),
});
console.log(res.status, await res.json());import os, requests
with open("contacts.csv", "rb") as f:
res = requests.post(
"https://api.app2email.com/v1/YOUR_NUMBER/contacts/import",
headers={
"Authorization": f"Bearer {os.environ['A2E_KEY']}",
"Content-Type": "text/csv",
},
data=f,
)
print(res.status_code, res.json())您會收到的回應: 已儲存多少列,以及被略過的列和原因。其餘的都會儲存。
{
"success": true,
"request_id": "i2gka",
"rows": 120,
"saved": 118,
"created": 90,
"updated": 28,
"skipped": 2,
"errors": [
{
"row": 7,
"problem": "'0412' must be a WhatsApp number with country code, digits only (8 to 15 digits), or a business-scoped user id like 61.AbC123"
}
],
"note": "Rows with a problem were skipped (the first 50 are listed); the rest were saved."
}同一個呼叫也接受 application/json:以 POST /contacts 格式的聯絡人清單。如果有人稍後才同意(網頁表單、結帳時的核取方塊),請把它連同證據記錄到該聯絡人上:
curl -s https://api.app2email.com/v1/YOUR_NUMBER/contacts/61412345678/consent \
-H "Authorization: Bearer $A2E_KEY" \
-H "Content-Type: application/json" \
-d '{
"marketing": true,
"source": "web form",
"text": "Yes, send me offers on WhatsApp",
"evidence": "https://example.com/forms/123"
}'只記錄您真正取得的同意。
選擇加入規則是號碼的一項設定。開啟後,MARKETING 範本只會發送給有選擇加入記錄的號碼。其他所有人都會被略過,並標示為 recipient_not_opted_in。Utility 範本和回覆不受影響。預設為關閉。
選擇加入記錄與聯絡人身上的同意是分開保存的,所以請在這裡也為每位同意的人記錄一次。每次呼叫最多 1000 筆,全部成功或全部失敗。
curl -s https://api.app2email.com/v1/YOUR_NUMBER/optins \
-H "Authorization: Bearer $A2E_KEY" \
-H "Content-Type: application/json" \
-d '{
"numbers": [
{ "number": "61412345678", "name": "John", "source": "web form", "note": "ticked the box", "at": "2026-10-01T09:00:00Z" },
{ "number": "61498765432", "name": "Mary", "source": "checkout", "at": "2026-10-12T02:30:00Z" }
]
}'
curl -s -X PUT https://api.app2email.com/v1/YOUR_NUMBER/settings/optin \
-H "Authorization: Bearer $A2E_KEY" \
-H "Content-Type: application/json" \
-d '{ "require_optin_for_marketing": true }'const headers = {
Authorization: `Bearer ${process.env.A2E_KEY}`,
"Content-Type": "application/json",
};
await fetch("https://api.app2email.com/v1/YOUR_NUMBER/optins", {
method: "POST",
headers,
body: JSON.stringify({
numbers: [
{ number: "61412345678", name: "John", source: "web form", note: "ticked the box", at: "2026-10-01T09:00:00Z" },
{ number: "61498765432", name: "Mary", source: "checkout", at: "2026-10-12T02:30:00Z" },
],
}),
});
await fetch("https://api.app2email.com/v1/YOUR_NUMBER/settings/optin", {
method: "PUT",
headers,
body: JSON.stringify({ require_optin_for_marketing: true }),
});headers = {"Authorization": f"Bearer {os.environ['A2E_KEY']}"}
requests.post(
"https://api.app2email.com/v1/YOUR_NUMBER/optins",
headers=headers,
json={
"numbers": [
{"number": "61412345678", "name": "John", "source": "web form", "note": "ticked the box", "at": "2026-10-01T09:00:00Z"},
{"number": "61498765432", "name": "Mary", "source": "checkout", "at": "2026-10-12T02:30:00Z"},
]
},
)
requests.put(
"https://api.app2email.com/v1/YOUR_NUMBER/settings/optin",
headers=headers,
json={"require_optin_for_marketing": True},
)您會收到的回應: 選擇加入的回應是 {"success": true, "request_id": "o9ahv", "saved": 2},設定的回應是 {"require_optin_for_marketing": true}。GET /v1/YOUR_NUMBER/optins?number=61412345678 會檢查單一號碼(opted_in 為 true 或 false)。
不論選擇加入記錄如何,行銷範本絕不會發送給 Do Not Call 名單上的號碼。回覆 STOP 的人會由 app2email 自己加入。請把在其他地方取消訂閱的人(您的商店、您的電子郵件名單、一通電話)加進來。最多 1000 個號碼,全部成功或全部失敗。
curl -s https://api.app2email.com/v1/YOUR_NUMBER/donotcall \
-H "Authorization: Bearer $A2E_KEY" \
-H "Content-Type: application/json" \
-d '{
"numbers": [
"61400111222",
{ "number": "61400333444", "name": "Sam", "note": "Unsubscribed in our CRM" }
]
}'const res = await fetch("https://api.app2email.com/v1/YOUR_NUMBER/donotcall", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.A2E_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
numbers: ["61400111222", { number: "61400333444", name: "Sam", note: "Unsubscribed in our CRM" }],
}),
});
console.log(await res.json());res = requests.post(
"https://api.app2email.com/v1/YOUR_NUMBER/donotcall",
headers={"Authorization": f"Bearer {os.environ['A2E_KEY']}"},
json={"numbers": ["61400111222", {"number": "61400333444", "name": "Sam", "note": "Unsubscribed in our CRM"}]},
)
print(res.json())您會收到的回應: 已 added 的號碼、already_on_list 的號碼,以及現在名單上有多少個。
{
"success": true,
"request_id": "d4nca",
"added": ["61400111222", "61400333444"],
"already_on_list": [],
"count": 37
}GET /v1/YOUR_NUMBER/donotcall?number=61400111222 會檢查單一號碼(on_list)。DELETE /v1/YOUR_NUMBER/donotcall/61400111222 會把號碼從名單中移除:只有在對方要求重新收到優惠時才這麼做。
撰寫優惠內容,用編號佔位符代表名字,在 example 中為它提供範例值,並加上說明如何停止的頁尾。STOP 及其各語言翻譯,都是 app2email 已經認得的退出用語。
curl -s https://api.app2email.com/v1/YOUR_NUMBER/templates \
-H "Authorization: Bearer $A2E_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "winter_sale",
"language": "en",
"category": "MARKETING",
"components": [
{
"type": "BODY",
"text": "Hi {{1}}, our winter sale starts today: 20% off everything until Sunday. Shop now: https://www.example.com/sale",
"example": { "body_text": [["John"]] }
},
{ "type": "FOOTER", "text": "Reply STOP to opt out" }
]
}'const res = await fetch("https://api.app2email.com/v1/YOUR_NUMBER/templates", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.A2E_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
name: "winter_sale",
language: "en",
category: "MARKETING",
components: [
{
type: "BODY",
text: "Hi {{1}}, our winter sale starts today: 20% off everything until Sunday. Shop now: https://www.example.com/sale",
example: { body_text: [["John"]] },
},
{ type: "FOOTER", text: "Reply STOP to opt out" },
],
}),
});
console.log(res.status, await res.json());res = requests.post(
"https://api.app2email.com/v1/YOUR_NUMBER/templates",
headers={"Authorization": f"Bearer {os.environ['A2E_KEY']}"},
json={
"name": "winter_sale",
"language": "en",
"category": "MARKETING",
"components": [
{
"type": "BODY",
"text": "Hi {{1}}, our winter sale starts today: 20% off everything until Sunday. Shop now: https://www.example.com/sale",
"example": {"body_text": [["John"]]},
},
{"type": "FOOTER", "text": "Reply STOP to opt out"},
],
},
)
print(res.status_code, res.json())您會收到的回應(HTTP 201):範本已送交 Meta 審查。
{
"success": true,
"request_id": "c3ppl",
"template": {
"id": "2234567890",
"name": "winter_sale",
"language": "en",
"category": "MARKETING",
"status": "PENDING"
},
"note": "Submitted to WhatsApp for review (minutes to a day). You get a template.status_changed webhook event with the result, or GET https://api.app2email.com/v1/4976659348270/templates/winter_sale."
}審查需要幾分鐘到一天。template.status_changed 事件會告訴您結果(status 為 APPROVED 且 can_send: true,或為 REJECTED 並附有 reason),或者您可以查詢 GET /v1/YOUR_NUMBER/templates/winter_sale。它的 example_request 是一個完整的發送內容,可以直接複製,而 quality_score(GREEN、YELLOW 或 RED)日後會顯示人們對它的反應。關於完整的審查流程,請參閱使用範本發送訂單和預約通知。
範本屬於 WhatsApp Business Account:該帳號下的每個號碼都可以使用。
分群是對您的聯絡人儲存的篩選條件。每個條件都必須成立:tags_any、tags_all、consent_marketing、last_inbound_days(最近 N 天內寫過訊息給您)和 search。最多 100 個分群。
curl -s https://api.app2email.com/v1/YOUR_NUMBER/segments \
-H "Authorization: Bearer $A2E_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Newsletter, consented",
"filter": { "tags_any": ["newsletter"], "consent_marketing": true }
}'const res = await fetch("https://api.app2email.com/v1/YOUR_NUMBER/segments", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.A2E_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
name: "Newsletter, consented",
filter: { tags_any: ["newsletter"], consent_marketing: true },
}),
});
const { segment } = await res.json();
console.log(segment.id, segment.contacts);res = requests.post(
"https://api.app2email.com/v1/YOUR_NUMBER/segments",
headers={"Authorization": f"Bearer {os.environ['A2E_KEY']}"},
json={"name": "Newsletter, consented", "filter": {"tags_any": ["newsletter"], "consent_marketing": True}},
)
segment = res.json()["segment"]
print(segment["id"], segment["contacts"])您會收到的回應(HTTP 201):該分群,以及目前符合的聯絡人數量。
{
"success": true,
"request_id": "s5gmt",
"segment": {
"id": 12,
"name": "Newsletter, consented",
"filter": { "tags_any": ["newsletter"], "consent_marketing": true },
"contacts": 240,
"created": "2026-11-21T01:00:00Z",
"updated": "2026-11-21T01:00:00Z"
}
}GET /v1/YOUR_NUMBER/segments/12/contacts?limit=200 會分頁列出符合的聯絡人(next_cursor)。分群是篩選條件,不是副本:撤回同意的聯絡人會從中消失。
recipients 為每個號碼提供它自己的值:這裡是匯入時的名字。每一批請發送一個請求,最多 max_numbers_per_request 個號碼(在 GET /usage 和 GET /me 中;群發上限,最多 1000)。
"background": true 會在所有檢查完成後立即回應,並在之後發送。campaign_name 是這個群發在活動記錄的 Broadcasts 之下的名稱。Idempotency-Key 標頭屬於該批次:如果您的工作在 24 小時內執行了兩次,該批次不會再次發送。curl -s https://api.app2email.com/v1/YOUR_NUMBER/messages \
-H "Authorization: Bearer $A2E_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: winter-sale-2026-batch-0" \
-d '{
"type": "template",
"campaign_name": "Winter sale 2026",
"background": true,
"template": { "name": "winter_sale", "language": { "code": "en" } },
"recipients": [
{
"to": "61412345678",
"components": [{ "type": "body", "parameters": [{ "type": "text", "text": "John" }] }]
},
{
"to": "61498765432",
"components": [{ "type": "body", "parameters": [{ "type": "text", "text": "Mary" }] }]
}
]
}'const BASE = "https://api.app2email.com/v1/YOUR_NUMBER";
const headers = {
Authorization: `Bearer ${process.env.A2E_KEY}`,
"Content-Type": "application/json",
};
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
async function call(path, init = {}) {
for (;;) {
const res = await fetch(BASE + path, { ...init, headers: { ...headers, ...init.headers } });
if (res.status === 429) {
const body = await res.json();
if (body.error.code !== "rate_limited") throw new Error(`${body.error.code}: ${body.error.how_to_fix}`);
await sleep(Number(res.headers.get("Retry-After") ?? 5) * 1000);
continue;
}
const body = await res.json();
if (!res.ok) throw new Error(`${body.error.code}: ${body.error.how_to_fix}`);
return body;
}
}
// 1. Everyone the segment matches, page by page
const contacts = [];
let cursor = "";
do {
const page = await call(`/segments/12/contacts?limit=200${cursor ? `&cursor=${encodeURIComponent(cursor)}` : ""}`);
contacts.push(...page.contacts);
cursor = page.next_cursor;
} while (cursor);
// 2. The most numbers per request
const { max_numbers_per_request: max } = await call("/usage");
// 3. One request per batch, each with its own Idempotency-Key
for (let i = 0, n = 0; i < contacts.length; i += max, n++) {
const batch = contacts.slice(i, i + max);
const body = await call("/messages", {
method: "POST",
headers: { "Idempotency-Key": `winter-sale-2026-batch-${n}` },
body: JSON.stringify({
type: "template",
campaign_name: `Winter sale 2026 (${n + 1})`,
background: true,
template: { name: "winter_sale", language: { code: "en" } },
recipients: batch.map((c) => ({
to: c.identity,
components: [
{ type: "body", parameters: [{ type: "text", text: c.custom_fields?.first_name || c.name || "there" }] },
],
})),
}),
});
if (body.status === "pending_approval") console.log("waiting for approval:", body.approval.url);
else console.log(body.status, body.broadcast.code, body.queued, body.skipped);
}import os, time, requests
BASE = "https://api.app2email.com/v1/YOUR_NUMBER"
HEADERS = {"Authorization": f"Bearer {os.environ['A2E_KEY']}"}
def call(method, path, **kw):
while True:
res = requests.request(method, BASE + path, headers={**HEADERS, **kw.pop("headers", {})}, **kw)
body = res.json()
if res.status_code == 429 and body["error"]["code"] == "rate_limited":
time.sleep(int(res.headers.get("Retry-After", "5")))
continue
if not res.ok:
raise RuntimeError(f"{body['error']['code']}: {body['error']['how_to_fix']}")
return body
# 1. Everyone the segment matches, page by page
contacts, cursor = [], None
while True:
page = call("GET", "/segments/12/contacts", params={"limit": 200, **({"cursor": cursor} if cursor else {})})
contacts += page["contacts"]
cursor = page.get("next_cursor")
if not cursor:
break
# 2. The most numbers per request
size = call("GET", "/usage")["max_numbers_per_request"]
# 3. One request per batch, each with its own Idempotency-Key
for n, i in enumerate(range(0, len(contacts), size)):
batch = contacts[i : i + size]
body = call(
"POST",
"/messages",
headers={"Idempotency-Key": f"winter-sale-2026-batch-{n}"},
json={
"type": "template",
"campaign_name": f"Winter sale 2026 ({n + 1})",
"background": True,
"template": {"name": "winter_sale", "language": {"code": "en"}},
"recipients": [
{
"to": c["identity"],
"components": [
{
"type": "body",
"parameters": [
{"type": "text", "text": c.get("custom_fields", {}).get("first_name") or c.get("name") or "there"}
],
}
],
}
for c in batch
],
},
)
if body["status"] == "pending_approval":
print("waiting for approval:", body["approval"]["url"])
else:
print(body["status"], body["broadcast"]["code"], body.get("queued"), body.get("skipped"))您會收到的回應(HTTP 202):檢查已通過,並已開始發送。請保存 broadcast.code:之後每個與這個群發有關的呼叫都會用到它。
{
"success": true,
"request_id": "t7wpe",
"status": "queued",
"from": "4976659348270",
"template": { "name": "winter_sale", "language": "en", "category": "MARKETING" },
"broadcast": {
"name": "Winter sale 2026",
"code": "k3XbQ9rTzP2mWv7a1c9e",
"report_url": "https://www.app2email.com/dashboard/log/broadcast/k3XbQ9rTzP2mWv7a1c9e",
"status_url": "https://api.app2email.com/v1/4976659348270/broadcasts/k3XbQ9rTzP2mWv7a1c9e"
},
"recipients": 2,
"queued": 2,
"skipped": 0,
"results": [],
"note": "Sending in the background. GET broadcast.status_url for progress and the result for each number, or use the broadcast.completed webhook."
}發送任何內容之前,每個號碼都會先被檢查。Do Not Call 名單上的號碼,以及(開啟選擇加入規則時)沒有選擇加入記錄的號碼,會被略過並計數,不會發送。
先測試。 在同一份內容中加入 "dry_run": true。所有項目都會像真實發送一樣被檢查(範本值、號碼、Do Not Call 名單、選擇加入規則、每月限額),回應會顯示每個號碼將收到的確切 WhatsApp 訊息。不會發送、記錄或計數,而且 Idempotency-Key 會被忽略。
直接發送給分群。 用 "segment": "Newsletter, consented"(它的 id 或完整名稱)取代 recipients,就能在一次呼叫中發送給該分群的每位聯絡人。對於使用具名佔位符的範本({{first_name}},以 "parameter_format": "NAMED" 建立),值會取自每位聯絡人:帶有 parameter_name 但沒有 text 的參數,會從聯絡人的 custom_fields 填入(name 取自聯絡人的姓名)。
{
"segment": "Newsletter, consented",
"type": "template",
"campaign_name": "November offer",
"template": {
"name": "november_offer",
"language": { "code": "en" },
"components": [
{ "type": "body", "parameters": [{ "type": "text", "parameter_name": "first_name" }] }
]
}
}在同一份內容中加入 send_at(含時區的 ISO 8601,從 1 分鐘後到 29 天內)。在客戶所在時區的早晨發送,通常比深夜發送效果更好。
{
"type": "template",
"campaign_name": "Winter sale 2026",
"template": { "name": "winter_sale", "language": { "code": "en" } },
"recipients": [
{ "to": "61412345678", "components": [{ "type": "body", "parameters": [{ "type": "text", "text": "John" }] }] }
],
"send_at": "2026-12-01T09:00:00+11:00"
}回應是 HTTP 202,帶有 status: "scheduled"、scheduled_for(UTC)、scheduled(有多少則訊息)和群發 code。所有項目會一次檢查完畢,而 Do Not Call 名單和每月限額會在時間到時再檢查一次,所以在這期間說了 STOP 的人不會收到。
GET /v1/YOUR_NUMBER/broadcasts/{code} 在群發進行期間會即時更新。
curl -s https://api.app2email.com/v1/YOUR_NUMBER/broadcasts/k3XbQ9rTzP2mWv7a1c9e \
-H "Authorization: Bearer $A2E_KEY"
# one row per message, for a spreadsheet
curl -s https://api.app2email.com/v1/YOUR_NUMBER/broadcasts/k3XbQ9rTzP2mWv7a1c9e/results.csv \
-H "Authorization: Bearer $A2E_KEY" -o winter-sale.csvconst res = await fetch("https://api.app2email.com/v1/YOUR_NUMBER/broadcasts/k3XbQ9rTzP2mWv7a1c9e", {
headers: { Authorization: `Bearer ${process.env.A2E_KEY}` },
});
const { broadcast, counts } = await res.json();
console.log(broadcast.status, counts);res = requests.get(
"https://api.app2email.com/v1/YOUR_NUMBER/broadcasts/k3XbQ9rTzP2mWv7a1c9e",
headers={"Authorization": f"Bearer {os.environ['A2E_KEY']}"},
)
body = res.json()
print(body["broadcast"]["status"], body["counts"])您會收到的回應: 該群發、它的統計數字,以及每個號碼的一筆結果。status 是 scheduled、inprogress、completed、cancelled、missed、interrupted、pending 或 unknown。每筆結果要不是訊息(帶有 status、times 和客戶的 reply),就是帶有 reason 的 skipped、not_sent 或 pending。
{
"success": true,
"request_id": "b6rsl",
"broadcast": {
"code": "k3XbQ9rTzP2mWv7a1c9e",
"name": "Winter sale 2026",
"created": "2026-12-01T09:00:00Z",
"status": "completed",
"sent_by": "api",
"template": { "name": "winter_sale", "language": "en" },
"report_url": "https://www.app2email.com/dashboard/log/broadcast/k3XbQ9rTzP2mWv7a1c9e"
},
"counts": {
"numbers": 240,
"skipped_do_not_call": 3,
"skipped_monthly_limit": 0,
"posted": 237,
"accepted": 236,
"sent": 236,
"delivered": 229,
"read": 171,
"failed": 1,
"replied": 19,
"opted_out": 2
},
"results": [
{
"message_id": "wamid.HBgLNjE0MTIzNDU2NzgVAgARGBJTQU1QTEVfVEVTVF9FVkVOVAA=",
"to": "61412345678",
"status": "read",
"sent_by": "api",
"broadcast_code": "k3XbQ9rTzP2mWv7a1c9e",
"text": "Hi John, our winter sale starts today: 20% off everything until Sunday. Shop now: https://www.example.com/sale",
"times": {
"submitted": "2026-12-01T09:00:00Z",
"accepted": "2026-12-01T09:00:01Z",
"sent": "2026-12-01T09:00:02Z",
"delivered": "2026-12-01T09:00:04Z",
"read": "2026-12-01T09:14:40Z"
},
"reply": { "at": "2026-12-01T09:15:10Z", "text": "Do you have it in blue?" },
"conversation_url": "https://www.app2email.com/conversation/61412345678_4976659348270_..."
},
{ "to": "61400111222", "status": "skipped", "reason": "On the Do Not Call list" }
]
}results.csv 每則訊息一列:號碼、狀態、message_id、每個步驟的時間、回覆和錯誤(若有追蹤連結,還會有 clicks 和 first_click_at)。以 =、+、- 或 @ 開頭的值,前面會加上 ',以免試算表把它們當作公式執行。GET /v1/YOUR_NUMBER/broadcasts 會列出您最近的群發,最新的在前。
優惠中的價格寫錯了?POST /v1/YOUR_NUMBER/broadcasts/{code}/cancel(權限範圍 messages:send)可以停止已排程或仍在發送中的 API 群發。
curl -s -X POST https://api.app2email.com/v1/YOUR_NUMBER/broadcasts/k3XbQ9rTzP2mWv7a1c9e/cancel \
-H "Authorization: Bearer $A2E_KEY"const res = await fetch("https://api.app2email.com/v1/YOUR_NUMBER/broadcasts/k3XbQ9rTzP2mWv7a1c9e/cancel", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.A2E_KEY}` },
});
console.log(res.status, await res.json());res = requests.post(
"https://api.app2email.com/v1/YOUR_NUMBER/broadcasts/k3XbQ9rTzP2mWv7a1c9e/cancel",
headers={"Authorization": f"Bearer {os.environ['A2E_KEY']}"},
)
print(res.status_code, res.json())您會收到的回應: 已排程的群發回應 HTTP 200(沒有任何內容被發送);正在發送中的群發回應 HTTP 202:已交給 WhatsApp 的訊息仍然會送出,其餘的則不會發送。
{
"success": true,
"request_id": "u1nqd",
"broadcast": { "code": "k3XbQ9rTzP2mWv7a1c9e", "status": "cancelling" },
"note": "Cancelling. Messages already handed to WhatsApp stay sent; the rest are not sent. GET https://api.app2email.com/v1/4976659348270/broadcasts/k3XbQ9rTzP2mWv7a1c9e shows the result."
}接著會有一個帶有 status: "cancelled" 的 broadcast.completed 事件。已完成的群發,以及從儀表板啟動的群發,會回應 409 broadcast_not_cancellable。
API 群發: 請自行根據結果建立下一份名單。GET /broadcasts/{code} 中的每筆結果都有訊息 status 和客戶的 reply,所以您可以挑選,例如,所有讀了優惠但沒有回覆的人,並像上面一樣用 POST /messages 向他們發送第二個範本。
const { results } = await (await fetch(`${BASE}/broadcasts/k3XbQ9rTzP2mWv7a1c9e`, { headers })).json();
const readNoReply = results.filter((r) => r.status === "read" && !r.reply).map((r) => r.to);從儀表板的群發頁面啟動的群發,還有兩項 API 可以使用的功能:
https://www.app2email.com/l/<code>。GET /broadcasts/{code}/clicks 會提供總點擊數、不重複點擊數、點擊率,以及每位收件人的點擊(連結預覽和爬蟲不會計入)。相同的數字也在 GET /broadcasts/{code} 的 clicks 中,而每次點擊都會有一個 link.clicked 事件送達。POST /broadcasts/{code}/retarget 會以相同的範本、值和媒體建立新的群發,對象是某一個 audience:not_read、read_not_clicked、clicked、replied(在發送後 7 天內回覆)或 not_replied。請先用 dry_run 計算數量:curl -s https://api.app2email.com/v1/YOUR_NUMBER/broadcasts/k3XbQ9rTzP2mWv7/retarget \
-H "Authorization: Bearer $A2E_KEY" \
-H "Content-Type: application/json" \
-d '{ "audience": "read_not_clicked", "dry_run": true }'const res = await fetch("https://api.app2email.com/v1/YOUR_NUMBER/broadcasts/k3XbQ9rTzP2mWv7/retarget", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.A2E_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ audience: "read_not_clicked", dry_run: true }),
});
console.log(await res.json());res = requests.post(
"https://api.app2email.com/v1/YOUR_NUMBER/broadcasts/k3XbQ9rTzP2mWv7/retarget",
headers={"Authorization": f"Bearer {os.environ['A2E_KEY']}"},
json={"audience": "read_not_clicked", "dry_run": True},
)
print(res.json())您會收到的回應: 帶有 dry_run 時,回傳數量(HTTP 200)。沒有它時,回應 HTTP 202 和新的群發,並在背景發送。
{
"success": true,
"request_id": "c3rtg",
"audience": "read_not_clicked",
"recipients": 131,
"broadcast": {
"code": "Mx8Pq2Lw5Rt7Yz3",
"name": "Summer sale - read not clicked",
"status": "inprogress",
"status_url": "https://api.app2email.com/v1/4976659348270/broadcasts/Mx8Pq2Lw5Rt7Yz3",
"report_url": "https://www.app2email.com/dashboard/log/broadcast/Mx8Pq2Lw5Rt7Yz3"
},
"note": "The new broadcast is sending in the background."
}Do Not Call 名單和方案限額會再次檢查,並適用金鑰的核准上限和每日上限。重新鎖定受眾、繼續和重試只適用於儀表板的群發:API 名單會回應 403 broadcast_not_resumable。
跟進訊息是另一則行銷訊息,會再次計費。請把它發給一小群有興趣的人(clicked、replied),而不是所有忽略了第一則訊息的人。
客戶會看到來自您企業名稱的訊息,內含優惠、他們的名字,以及頁尾的「Reply STOP to opt out」。如果他們回覆,24 小時視窗就會開啟,您可以從 API 或透過電子郵件以自由文字回覆。
在您這一端,會收到這些事件(用 POST /v1/YOUR_NUMBER/webhooks 和一個公開的 https url 新增 webhook;權限範圍 webhooks:manage)。還沒有公開網址?GET /v1/YOUR_NUMBER/events?wait=25 可以取得相同的事件。
message.status:每則訊息往後的進展:sent、delivered、read 或 failed。broadcast_code 說明它屬於哪個群發,pricing.category 說明 Meta 如何計算它。
{
"id": "evt_Xq3k9m2Lw8Rt5Yp1Zs01",
"type": "message.status",
"created": "2026-12-01T09:00:04.000Z",
"number": "4976659348270",
"data": {
"message_id": "wamid.HBgLNjE0MTIzNDU2NzgVAgARGBJTQU1QTEVfVEVTVF9FVkVOVAA=",
"to": "61412345678",
"status": "delivered",
"timestamp": "2026-12-01T09:00:04.000Z",
"sent_by": "api",
"broadcast_code": "k3XbQ9rTzP2mWv7a1c9e",
"whatsapp_status": "delivered",
"recipient_user_id": "AU.1234567890123456",
"pricing": { "billable": true, "pricing_model": "PMP", "type": "regular", "category": "marketing" }
}
}message.failed:當訊息無法送達時。行銷訊息中您會看到的一種是 Meta 錯誤 131049:因為對方最近收到很多行銷訊息,WhatsApp 暫時擋下了這則訊息。24 小時內不要再次發送;太早重試會讓封鎖持續更久。
{
"id": "evt_Pa3k9m2Lw8Rt5Yp1Zs011",
"type": "message.failed",
"created": "2026-12-01T09:00:03.000Z",
"number": "4976659348270",
"data": {
"message_id": "wamid.HBgLNjE0MTIzNDU2NzgVAgARGBJTQU1QTEVfVEVTVF9FVkVOVAA=",
"to": "61412345678",
"status": "failed",
"timestamp": "2026-12-01T09:00:03.000Z",
"sent_by": "broadcast",
"whatsapp_status": "failed",
"error": {
"code": 131049,
"message": "This message was not delivered to maintain healthy ecosystem engagement.",
"title": "This message was not delivered to maintain healthy ecosystem engagement.",
"error_code": "marketing_per_user_limit",
"how_to_fix": "WhatsApp held this marketing message back: the person has had many marketing messages lately. Do not send it again within 24 hours, because retrying sooner keeps the block longer.",
"is_retriable": false,
"retry_after_seconds": 86400
}
}
}message.received:當客戶回覆時:打字回覆為 text,點選按鈕為 button。
contact.opted_out:當客戶把自己加入 Do Not Call 名單時。source 是 stop_promotions(他們點選了「Stop promotions」)、whatsapp_stop 或 keyword(他們發送了退出用語)。
{
"id": "evt_Xq3k9m2Lw8Rt5Yp1Zs01",
"type": "contact.opted_out",
"created": "2026-12-01T09:20:00.000Z",
"number": "4976659348270",
"data": {
"number": "61412345678",
"name": "John Smith",
"source": "stop_promotions",
"detail": "Stop promotions",
"timestamp": "2026-12-01T09:20:00.000Z"
}
}link.clicked:每次點擊追蹤連結時(儀表板群發)。對於該收件人的連結,第一次點擊時 first_click 為 true。
{
"id": "evt_Cmp3k9m2Lw8Rt5Yp1Zs01",
"type": "link.clicked",
"created": "2026-11-19T01:00:00.000Z",
"number": "4976659348270",
"data": {
"contact": "61412345678",
"url": "https://example.com/sale",
"broadcast_code": "k3XbQ9rTzP2mWv7",
"sequence_id": null,
"step_id": null,
"first_click": true,
"clicks": 1,
"browser": "Chrome",
"timestamp": "2026-11-19T01:00:00.000Z"
}
}broadcast.completed:每個群發一次,在它完成、被取消,或錯過排程時間時。
{
"id": "evt_Xq3k9m2Lw8Rt5Yp1Zs01",
"type": "broadcast.completed",
"created": "2026-12-01T09:04:00.000Z",
"number": "4976659348270",
"data": {
"code": "k3XbQ9rTzP2mWv7a1c9e",
"name": "Winter sale 2026",
"status": "completed",
"sent_by": "api",
"numbers": 240,
"posted": 237,
"accepted": 236,
"errors": 1,
"skipped_do_not_call": 3,
"skipped_monthly_limit": 0,
"status_url": "https://api.app2email.com/v1/4976659348270/broadcasts/k3XbQ9rTzP2mWv7a1c9e",
"report_url": "https://www.app2email.com/dashboard/log/broadcast/k3XbQ9rTzP2mWv7a1c9e"
}
}GET /v1/YOUR_NUMBER/stats?from=&to= 會彙總某段期間內,跨群發的已發送、已送達、已讀、失敗和已回覆的數量及比率。
有兩筆帳單:
skipped_monthly_limit),或回應 429 monthly_limit_reached。發送之前,請用 WhatsApp 價格計算器估算。發送之後,GET /v1/YOUR_NUMBER/usage 中的 meta_pricing 會依 Meta 的類別統計該計費月的訊息,並附上參考費用,而 GET /v1/YOUR_NUMBER/usage/meta 則按天提供。
一旦 Meta 讓您的帳號加入其 Marketing Messages API,行銷範本預設就會走那條路徑(該號碼的設定 messages.marketing_route,為 auto)。GET /v1/YOUR_NUMBER/marketing 會顯示路徑,發送回應中的 sent_via 則說明某則訊息走的是哪條路。您的請求不需要任何改變。
WhatsApp 會觀察人們對您訊息的反應。大量的封鎖和檢舉會降低您的品質評級。於是:
quality_score(在 GET /templates/{name} 中)會變成 YELLOW,然後 RED,而 RED 的範本可能被暫停(422 template_paused,Meta 錯誤 132015);paused_by_meta,原因在 status_notes 中);請修正原因,然後 POST /broadcasts/{code}/resume 會繼續執行。GET /v1/YOUR_NUMBER/health(權限範圍 messages:read)會顯示該號碼的 quality_rating 和 messaging_limit:
{
"success": true,
"request_id": "h7q2m",
"health": {
"can_send_message": "AVAILABLE",
"quality_rating": "GREEN",
"messaging_limit": "TIER_2K",
"throughput": "STANDARD",
"status": "CONNECTED",
"name_status": "APPROVED",
"account_mode": "LIVE"
},
"fetched_at": "2026-11-06T01:00:00.000Z"
}如何維持綠色:
last_inbound_days),並在發送其餘部分之前,先觀察第一部分的已讀和退出情況。每個事件都有標頭 X-App2email-Signature: t=<unix seconds>,v1=<hex>。v1 的值是 "<t>.<raw body>" 的 HMAC-SHA256,以 webhook 的密鑰(whsec_...,包含前綴)為金鑰。請檢查每一個 v1=(輪換之後,舊密鑰仍保留期間會有兩個),針對完全按收到原樣的原始請求內容計算,並拒絕過舊的 t。X-Hub-Signature-256: sha256=<hex>(原始請求內容的 HMAC-SHA256,只使用目前的密鑰)也同樣提供,供為 Meta webhook 撰寫的程式碼使用。
import crypto from "node:crypto";
import express from "express";
export function verifyWebhook(rawBody, header, secret, toleranceSeconds = 300) {
const t = /(?:^|,)\s*t=(\d+)/.exec(header ?? "")?.[1];
const v1 = [...(header ?? "").matchAll(/(?:^|,)\s*v1=([0-9a-f]+)/g)].map((m) => m[1]);
if (!t || v1.length === 0 || Math.abs(Date.now() / 1000 - Number(t)) > toleranceSeconds) return false;
const expected = crypto.createHmac("sha256", secret).update(t + ".").update(rawBody).digest("hex");
return v1.some((v) => v.length === expected.length && crypto.timingSafeEqual(Buffer.from(v), Buffer.from(expected)));
}
const app = express();
app.post("/app2email", express.raw({ type: "application/json" }), async (req, res) => {
if (!verifyWebhook(req.body, req.get("X-App2email-Signature"), process.env.WEBHOOK_SECRET)) return res.sendStatus(401);
if (await alreadySeen(req.get("X-App2email-Delivery"))) return res.sendStatus(200); // a retry
const event = JSON.parse(req.body);
res.sendStatus(200); // answer within 10 seconds, then do the work
switch (event.type) {
case "message.status":
case "message.failed":
await saveStatus(event.data.broadcast_code, event.data.to, event.data.message_id, event.data.status, event.data.error);
break;
case "contact.opted_out":
await markUnsubscribed(event.data.number, event.data.source); // in your CRM too
break;
case "broadcast.completed":
await saveBroadcastTotals(event.data);
break;
}
});import hashlib, hmac, json, os, re, time
from flask import Flask, request
def verify_webhook(raw_body: bytes, header: str, secret: str, tolerance: int = 300) -> bool:
t = re.search(r"(?:^|,)\s*t=(\d+)", header or "")
v1 = re.findall(r"(?:^|,)\s*v1=([0-9a-f]+)", header or "")
if not t or not v1 or abs(time.time() - int(t.group(1))) > tolerance:
return False
expected = hmac.new(secret.encode(), t.group(1).encode() + b"." + raw_body, hashlib.sha256).hexdigest()
return any(hmac.compare_digest(v, expected) for v in v1)
app = Flask(__name__)
@app.post("/app2email")
def app2email():
raw = request.get_data()
if not verify_webhook(raw, request.headers.get("X-App2email-Signature"), os.environ["WEBHOOK_SECRET"]):
return "", 401
if already_seen(request.headers.get("X-App2email-Delivery")):
return "", 200 # a retry
event = json.loads(raw)
queue.put(event) # handle it after answering
return "", 200 # within 10 seconds請在 10 秒內回應 2xx 狀態。否則該事件會在 10 秒、1 分鐘、5 分鐘、30 分鐘、1、2、4、8 和 16 小時之後再次發送。X-App2email-Delivery(事件 id,evt_...)在每次重試時都相同,所以請把它儲存起來,並略過您已處理過的事件。
事件可能亂序抵達:read 可能先於它的 delivered 出現。請為每個 message_id 保留最靠前的狀態,不要退回。對於群發,請以 broadcast_code 和 to 作為您記錄的鍵值。
請為每一批提供一個屬於該活動和該批次、而不是屬於該次嘗試的 Idempotency-Key:winter-sale-2026-batch-0、winter-sale-2026-batch-1。24 小時內以相同的金鑰發送相同的請求,不會再次發送;它會得到第一次的回應,並附有標頭 Idempotent-Replayed: true。
422 idempotency_key_reused。請讓各批次維持相同的順序,或為新名單使用新的金鑰。409 idempotency_request_in_progress。請等待,並以相同的金鑰重試。409 idempotency_request_interrupted。部分訊息可能已經發出:在用新的金鑰發送之前,請先檢查 GET /broadcasts。金鑰會保留 24 小時。另外,請把每一批的 broadcast.code 存在您的資料庫中,如果某一批已經有了,就不要再發送。
請每一批用一次呼叫發送清單,而不是每個號碼各呼叫一次。每個回應都有 X-RateLimit-Limit、X-RateLimit-Remaining、X-RateLimit-Reset(距離恢復額滿的秒數)和 X-RateLimit-Policy;GET /me 中的 limits 會顯示金鑰的 requests_per_second 和 burst。超過限制時,您會得到帶有 Retry-After 標頭和 error.retry_after_seconds 的 429 rate_limited:等待該段時間,然後再次發送相同的請求。
500、502、503 或逾時:以逐漸加長的等待時間重試幾次,並使用相同的 Idempotency-Key。429 whatsapp_rate_limit 或 429 too_many_messages_to_recipient:WhatsApp 自己的限制。請退避數分鐘,而不是數秒。429 monthly_limit_reached、429 monthly_cap_reached 或 429 daily_cap_reached:方案、號碼或金鑰的上限。在重設之前不要重試,或調高上限。4xx:不要不加修改就重試。請依 error.code 判斷並照著 how_to_fix 處理。error.is_retriable 會告訴您相同的請求日後是否可能成功。金鑰可以有每日上限和核准關卡(GET /me 會顯示它們)。發送給的聯絡人超過關卡允許的數量時,會回應 HTTP 202,帶有 status: "pending_approval" 和 approval.url:這不是錯誤。真人會在儀表板上核准,接著 approval.resolved 事件送達,然後訊息才會發出。在此期間,不要用其他方式發送同一份名單。對於會發送行銷訊息的金鑰,這是一道很好的安全網。
contact.opted_out 通知您。您可以用 PUT /v1/YOUR_NUMBER/settings/number 和 {"compliance": {"stop_keywords_extra": ["UNSUBSCRIBE"]}}(權限範圍 settings:manage)新增您自己的退出用語。POST /contacts/{identity}/consent,帶有 "marketing": false),讓帶有 consent_marketing: true 的分群把他們排除在外;如果他們是在別處取消訂閱,也請把他們加入 Do Not Call 名單。403 recipient_stopped_marketing(Meta 錯誤 131050)。如果他們再次開啟,會收到帶有 change: "marketing_resumed" 的 contact.updated。GET /v1/YOUR_NUMBER/compliance/export.csv(權限範圍 dnc:manage)會把同意記錄、Do Not Call 名單和選擇加入記錄整合成一個檔案,這些是 Spam Act 2003 期望您能夠出示的記錄。群發是範本,所以可以隨時發出。當客戶回覆時,24 小時視窗就會開啟,您可以用一般文字、圖片或按鈕回覆(app2email 會提早 15 分鐘停止)。GET /v1/YOUR_NUMBER/conversations/61412345678 會顯示 window_state 和 window_closes_at。如果他們的最後一則訊息本身就是退出訊息,回覆會得到 403 recipient_opted_out,直到他們再次寫訊息為止。
每個錯誤都是帶有 error.code、message、how_to_fix 的 JSON,以及一個可向支援團隊提供的 request_id。所有代碼請見錯誤,各項限制請見限制。
| 代碼 | 發生時機 | 處理方式 |
|---|---|---|
403 insufficient_scope | 金鑰缺少某項權限(details.required_scope) | 使用具備上表權限範圍的金鑰 |
403 sandbox_key | 用沙盒金鑰建立範本、PUT /settings/optin 或重新鎖定受眾 | 這些呼叫請使用一般金鑰 |
400 invalid_csv | CSV 沒有標題列,或沒有聯絡人列 | 發送一個標題列和至少一列資料,最多 5000 列 |
400 invalid_template_category | category 不是 MARKETING、UTILITY 或 AUTHENTICATION | 促銷內容請使用 MARKETING |
422 template_not_approved | 範本正在審核中、已被拒絕、已暫停或已停用 | 等待核准,或修正它;請檢查 GET /templates/{name} |
422 template_parameters_invalid | 值與範本不符 | 依 details.problems 和 example_request 修正內容 |
422 template_paused | Meta 錯誤 132015:因品質偏低而暫停 | 使用另一個範本,或編輯這個範本;發送給較少、更相符的人 |
400 too_many_recipients | 號碼數量超過該號碼在單一請求中可以發送的上限 | 分成每批 details.max_recipients 的批次 |
400 to_and_recipients | 同時使用了 to 和 recipients | 兩者擇一 |
400 segment_and_recipients | segment 與 to、recipient 或 recipients 一起使用 | 只使用 segment |
400 segment_empty | 該分群沒有符合的聯絡人 | 檢查 GET /segments/{id}/contacts,新增聯絡人或更改篩選條件 |
404 segment_not_found | 沒有符合該 id 或名稱的分群 | GET /segments 會列出它們;請使用 id 或完整名稱 |
403 recipient_opted_out | 單一號碼,且在 Do Not Call 名單上 | 不要向他們發送行銷訊息;在名單中時,它會被略過 |
403 recipient_not_opted_in | 單一號碼,選擇加入規則已開啟,且它沒有選擇加入記錄 | 先用 POST /optins 記錄他們的同意;在名單中時,它會被略過 |
403 recipient_stopped_marketing | Meta 錯誤 131050:他們在 WhatsApp 中關閉了您的行銷訊息 | 不要向他們發送行銷範本 |
422 marketing_per_user_limit | Meta 錯誤 131049:他們最近收到很多行銷訊息 | 24 小時內不要重新發送 |
403 messaging_limit_restricted | Meta 錯誤 131064:Meta 因範本類別錯誤而降低了訊息發送上限 | 檢查您的範本類別;上限會在 Meta 的期間過後恢復 |
403 whatsapp_payment_issue | Meta 錯誤 131042:Meta 無法向您的 WhatsApp 帳號扣款 | 在 WhatsApp Manager 中新增或修正付款方式 |
400 send_at_too_far | send_at 在 29 天以後 | 使用從現在起 1 分鐘到 29 天內、含時區的時間 |
422 idempotency_key_reused | 相同的 Idempotency-Key,不同的內容 | 不同的名單請使用新的金鑰 |
429 rate_limited | 此金鑰的呼叫次數過多 | 等待 Retry-After 秒,然後重試 |
429 whatsapp_rate_limit | WhatsApp 的速率限制(Meta 130429、131048 等) | 放慢速度,一分鐘或更久之後再試 |
429 monthly_limit_reached | 本月方案的訊息額度已用完 | 等待下個計費月,或升級 |
429 daily_cap_reached | 金鑰的每日上限 | 等到 UTC 午夜,或調高上限 |
409 broadcast_not_cancellable | 群發已完成、已被取消,或是從儀表板啟動的 | 只有已排程或仍在發送中的 API 發送可以取消 |
403 broadcast_not_resumable | 對 API 名單執行重新鎖定受眾、繼續或重試 | 對於 API 名單,請用 POST /messages 再次發送您要的號碼 |
400 invalid_retarget_audience | audience 不是這五個值之一 | 使用 not_read、read_not_clicked、clicked、replied 或 not_replied |
409 broadcast_nothing_to_send | 該受眾中沒有人了 | 無需處理 |
403 campaign_approval_needed | 重新鎖定受眾會發送超過金鑰核准上限的數量 | 從儀表板啟動,或使用沒有核准上限的金鑰 |