جرب WhatsApp API ديال app2email بمفتاح sandbox فوري وبلا حساب، من بعد ربط الرقم ديالك، صيفط أول template ديالك، تابع حالتها، واقرا الجواب.
هاد الدليل غادي ياخدك من الصفر حتى لرسالة WhatsApp وجوابها، فجوج أجزاء.
الجزء 1، الـ sandbox الفوري (حوالي دقيقتين، بلا حساب): غادي تاخد مفتاح لرقم تجريبي، تصيفط template لزبون وهمي، تشوفها كتمشي من sent حتى read، وتقرا جواب الزبون. ما كيوصلش والو لـ WhatsApp، ولكن كل طلب وكل جواب عندو شكل الـ API الحقيقي، فنفس الكود كيخدم من بعد.
الجزء 2، رقمك ديالك: كتسجل، كتربط رقم WhatsApp ديالك، كتصاوب مفتاح API، وكتصيفط نفس النوع ديال الرسالة لتليفون حقيقي.
شنو كيشوف الزبون (الجزء 2): رسالة WhatsApp من اسم البزنس ديالك، مثلا "Hi Ava, your order #1234 has shipped." ملي يجاوب، تقدر تجاوبو بنص عادي فـ 24 ساعة اللي جاية.
شنو كتشوف نتا: جواب الصيفط مع message_id، حالة هاديك الرسالة (sent، delivered، read)، جواب الزبون كحدث message.received، وكاع الرسايل فـ Activity Log وInbox ديال app2email.
curl، ولا Node.js 18+، ولا Python 3.9+ مع requests. والباقي والو.| الصلاحية | شنو كتدير ليها فهاد الدليل |
|---|---|
messages:send | صيفط الـ template والجواب (POST /messages) |
messages:read | عيّط الـ templates ديالك (GET /templates)، اقرا حالة رسالة (GET /messages/{message_id}) وجيب الأحداث (GET /events) |
webhooks:manage | غير إلا بغيتي الأحداث توصل لسيرفر ديالك (POST /webhooks) |
GET /me كيخدم بأي مفتاح صالح، مهما كانت صلاحياتو.
الـ sandbox الفوري هو رقم WhatsApp تجريبي، 12025550100، فيه خمسة زبناء وهميين كيتصرفو بحال الحقيقيين. ما خاصك حتى حساب ولا مفتاح باش تبدا.
شنو كيعطيك:
POST https://api.app2email.com/v1/account/sandbox، بلا مفتاح وبلا body، كيجاوب بمفتاح sandbox فوري (a2es_...). كيتبان مرة وحدة، وصالح 7 أيام. كيخدم غير على الرقم التجريبي.sandbox_recipient.hello_world (en_US، UTILITY)، وorder_update (en، UTILITY) وweekend_offer (en، MARKETING). كيتشيكو بنفس الكود لي كيتشيك الـ templates الحقيقية.GET /me، GET /templates، POST /messages، GET /messages، GET /conversations، GET /conversations/{contact}، PUT /conversations/{contact}/owner، GET /events، وPOST /sandbox/inbound (كيخلي زبون وهمي يكتب ليك). أي نداء آخر كيجاوب 403 not_in_instant_sandbox.GET /events بدل webhook.curl -X POST https://api.app2email.com/v1/account/sandboxconst res = await fetch("https://api.app2email.com/v1/account/sandbox", { method: "POST" });
const { instant_sandbox } = await res.json();
console.log(instant_sandbox.api_key, instant_sandbox.expires);import requests
res = requests.post("https://api.app2email.com/v1/account/sandbox", timeout=10)
sandbox = res.json()["instant_sandbox"]
print(sandbox["api_key"], sandbox["expires"])شنو كتاخد (مختصر: الجواب كيعطي كذلك لائحة النداءات ديالو وأول النداءات لي خاصك تدير، فـ calls وtry_first):
{
"success": true,
"request_id": "s4ndb",
"instant_sandbox": {
"api_key": "a2es_000qlA9iTHS1NETB9JExample...",
"expires": "2026-11-22T03:00:00.000Z",
"number": "12025550100",
"base_url": "https://api.app2email.com/v1/12025550100",
"mcp_url": "https://api.app2email.com/mcp",
"authorization": "Authorization: Bearer <api_key>",
"test_contacts": [
{ "number": "12025550101", "name": "Ava", "behaviour": "answers every message a few seconds later" },
{ "number": "12025550102", "name": "Ben", "behaviour": "reads, never answers: a free-form message to him is 422 outside_24h_window" },
{ "number": "12025550103", "name": "Cara", "behaviour": "delivery fails: message.status failed and message.failed" },
{ "number": "12025550104", "name": "Dan", "behaviour": "answers STOP: contact.opted_out, then a marketing template to him is 403 recipient_opted_out" },
{ "number": "12025550105", "name": "Eve", "behaviour": "asks for a person: set the conversation's owner to human" }
],
"templates": ["hello_world (en_US, UTILITY)", "order_update (en, UTILITY)", "weekend_offer (en, MARKETING)"],
"not_here": "Webhooks (use GET /events), media uploads, contacts, broadcasts in the background, scheduled sends and every other call need a connected number: they answer 403 not_in_instant_sandbox here."
},
"next": "For a real WhatsApp number call create_account with the person's e-mail address: they confirm, connect their number and choose a plan.",
"documentation_url": "https://www.app2email.com/docs/api/sandbox"
}خزن api_key: ما كيتبانش مرة أخرى. إلا ضاع، صاوب واحد جديد. تحت، SANDBOX_KEY كيمثل هادا المفتاح. باش تتأكد أنو كيخدم: GET https://api.app2email.com/v1/12025550100/me بـ Authorization: Bearer SANDBOX_KEY.
GET /templates كيعرض كاع الـ templates بالقيم لي محتاجينها، وexample_request كامل تقدر تصيفطو من بعد ما تبدل القيم.
curl https://api.app2email.com/v1/12025550100/templates \
-H "Authorization: Bearer SANDBOX_KEY"const KEY = process.env.SANDBOX_KEY;
const API = "https://api.app2email.com/v1/12025550100";
const res = await fetch(`${API}/templates`, { headers: { Authorization: `Bearer ${KEY}` } });
const { templates } = await res.json();
for (const t of templates) console.log(t.name, t.language, t.status, t.needs);import os, requests
KEY = os.environ["SANDBOX_KEY"]
API = "https://api.app2email.com/v1/12025550100"
res = requests.get(f"{API}/templates", headers={"Authorization": f"Bearer {KEY}"}, timeout=10)
for t in res.json()["templates"]:
print(t["name"], t["language"], t["status"], t.get("needs"))كل سطر فيه name، وlanguage، وcategory، وstatus، وcan_send، وneeds، و، للـ templates الموافَق عليها، example_request. order_update محتاجة جوج قيم نصية فالـ body: سمية الزبون ورقم الطلب.
Ava (12025550101) كتجاوب على كل رسالة بعد شي ثواني. الـ template هي الرسالة لي تقدر تصيفطها فأي وقت، حتى لشي واحد ما كتبلكش عاد.
curl -X POST https://api.app2email.com/v1/12025550100/messages \
-H "Authorization: Bearer SANDBOX_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "12025550101",
"type": "template",
"template": {
"name": "order_update",
"language": { "code": "en" },
"components": [
{ "type": "body", "parameters": [
{ "type": "text", "text": "Ava" },
{ "type": "text", "text": "#1234" }
] }
]
}
}'const res = await fetch(`${API}/messages`, {
method: "POST",
headers: { Authorization: `Bearer ${KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({
to: "12025550101",
type: "template",
template: {
name: "order_update",
language: { code: "en" },
components: [
{ type: "body", parameters: [{ type: "text", text: "Ava" }, { type: "text", text: "#1234" }] },
],
},
}),
});
const sent = await res.json();
console.log(res.status, sent.message_id, sent.status);res = requests.post(
f"{API}/messages",
headers={"Authorization": f"Bearer {KEY}"},
json={
"to": "12025550101",
"type": "template",
"template": {
"name": "order_update",
"language": {"code": "en"},
"components": [
{"type": "body", "parameters": [{"type": "text", "text": "Ava"}, {"type": "text", "text": "#1234"}]}
],
},
},
timeout=10,
)
sent = res.json()
print(res.status_code, sent.get("message_id"), sent.get("status"))شنو كتاخد (HTTP 200، مختصر): الرسالة تقبلات. text هي الرسالة كيفما كيشوفها الزبون.
{
"success": true,
"request_id": "kxrkf",
"message_id": "wamid.HBgLNjE0MTIzNDU2NzgVAgARGBJTQU1QTEVfVEVTVF9FVkVOVAA=",
"status": "accepted",
"from": "12025550100",
"to": "12025550101",
"template": { "name": "order_update", "language": "en", "category": "UTILITY" },
"text": "Hi Ava, your order #1234 has shipped."
}القيمة الغالطة كترجع ليك خطأ بـ error.code ثابت، وhow_to_fix، وإلا كان الغلط فالـ template، example_request صحيح كامل. جربها: حيد متغير وحد، وغتجيك 422 template_parameters_invalid.
GET /events?wait=25 كيستنى حتى 25 ثانية للحدث الجاي، يعني ماخاصكش عنوان عام. غتجيك message.status بـ sent وdelivered وread، ومن بعد message.received بجواب Ava.
curl "https://api.app2email.com/v1/12025550100/events?wait=25" \
-H "Authorization: Bearer SANDBOX_KEY"let after = "";
for (let i = 0; i < 5; i++) {
const q = after ? `&after=${encodeURIComponent(after)}` : "";
const res = await fetch(`${API}/events?wait=25${q}`, { headers: { Authorization: `Bearer ${KEY}` } });
const page = await res.json();
for (const e of page.events ?? []) console.log(e.type, e.data.status ?? e.data.text);
after = page.cursor ?? after;
}after = ""
for _ in range(5):
params = {"wait": 25, **({"after": after} if after else {})}
page = requests.get(f"{API}/events", params=params,
headers={"Authorization": f"Bearer {KEY}"}, timeout=40).json()
for e in page.get("events", []):
print(e["type"], e["data"].get("status") or e["data"].get("text"))
after = page.get("cursor", after)شنو كتاخد (مختصر؛ كلام Ava كيتبدل):
{
"success": true,
"request_id": "e7fd2",
"events": [
{
"id": "evt_Xq3k9m2Lw8Rt5Yp1Zs01",
"type": "message.status",
"created": "2026-11-15T03:10:02.000Z",
"number": "12025550100",
"data": {
"message_id": "wamid.HBgLNjE0MTIzNDU2NzgVAgARGBJTQU1QTEVfVEVTVF9FVkVOVAA=",
"to": "12025550101",
"status": "delivered",
"timestamp": "2026-11-15T03:10:01.000Z",
"sent_by": "api"
}
},
{
"id": "evt_Ab7c2d9Ef4Gh6Jk8Lm03",
"type": "message.received",
"created": "2026-11-15T03:10:09.000Z",
"number": "12025550100",
"data": {
"message_id": "wamid.HBgLNjE0MTIzNDU2NzgVAgASGBQzQUZCMTY0MDc2MUYwNzBDNTY5MAA=",
"from": "12025550101",
"name": "Ava",
"type": "text",
"text": "Thanks! When will it arrive?",
"timestamp": "2026-11-15T03:10:08.000Z"
}
}
],
"count": 2,
"cursor": "ec_184467",
"has_more": false
}صيفط cursor كـ after فالنداء الجاي باش تجيب غير الأحداث الجداد. كل حدث هو نفس الـ JSON لي غيجي لـ webhook من بعد، بنفس id. types=message.received كيجيب غير الرسايل الواصلة. GET /messages كذلك كيعرض الرسايل، وكل رسالة صيفطاتي فيها status وtimes ديالها.
Ava دابا كاتبت ليك، فالنافذة ديال 24 ساعة ديالها مفتوحة، وتقدر تصيفط نص حر:
curl -X POST https://api.app2email.com/v1/12025550100/messages \
-H "Authorization: Bearer SANDBOX_KEY" \
-H "Content-Type: application/json" \
-d '{"to": "12025550101", "type": "text", "text": {"body": "It arrives on Friday."}}'نفس النص لـ Ben (12025550102)، لي ما كتبلكش عاد، كيجاوب 422 outside_24h_window: برا النافذة غير الـ template تقدر تتصيفط.
| الزبون | صيفط ليه | شنو تتعلم |
|---|---|---|
Ben، 12025550102 | نص | كيقرا ولكن ما كيجاوبش أبدا: 422 outside_24h_window للنص الحر |
Cara، 12025550103 | hello_world | التوصيل كيفشل: message.status بـ failed، وmessage.failed |
Dan، 12025550104 | order_update، من بعد weekend_offer | كيجاوب STOP: contact.opted_out، ومن بعد الـ template التسويقية كتجيك 403 recipient_opted_out |
Eve، 12025550105 | أي template | كتطلب شي واحد حقيقي: سلّم الشات بـ PUT /conversations/{contact}/owner و"owner": "human" |
من مساعد AI بدل terminal: سيرفر Management MCP https://api.app2email.com/mcp/manage عندو الأداة create_sandbox، والمفتاح الفوري كيخدم كذلك على سيرفر MCP https://api.app2email.com/mcp (check_key، list_templates، send_template، list_events، wait_for_message ...). شوف خلّي وكيل AI يسير WhatsApp ديالك بـ MCP وSandbox.
جانب Meta هو لي كيقرر واش الرسايل كتمشي فعلا: زيد طريقة دفع فحساب WhatsApp Business ديالك، وثبّت البزنس ديالك، وخلي اسم العرض ديالك يتوافق عليه. Getting started كيشرح ليك هادشي خطوة بخطوة.
فصفحة مفاتيح API، صاوب مفتاح بـ messages:send وmessages:read (زيد webhooks:manage إلا بغيتي webhook). المفتاح (a2en_...) كيتبان مرة وحدة: خليه فالسيرفر ديالك، ماشي فصفحة ويب ولا فـ log.
علّم Sandbox key ملي تصاوبو باش تجرب فرقمك ديالك الأول: كاع الشيكات كتدار على حسابك، والو ما كيتصيفطش لـ WhatsApp، والجوابات فيها "sandbox": true، والـ message ids كتبدا بـ wamid.SANDBOX.، وأحداث message.status كتبقى كتوصل. صاوب مفتاح ثاني بلا العلامة ملي تكون لتيت باش تصيفط بجد.
فكاع نداء، YOUR_NUMBER هو رقم WhatsApp لي كتصيفط منو: رمز البلاد الأول، وغير الأرقام.
curl https://api.app2email.com/v1/YOUR_NUMBER/me \
-H "Authorization: Bearer YOUR_API_KEY"const res = await fetch("https://api.app2email.com/v1/YOUR_NUMBER/me", {
headers: { Authorization: `Bearer ${process.env.API_KEY}` },
});
console.log(await res.json());import os, requests
res = requests.get("https://api.app2email.com/v1/YOUR_NUMBER/me",
headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, timeout=10)
print(res.json())شنو كتاخد:
{
"success": true,
"request_id": "a7k3p",
"key_valid": true,
"api_version": "v1",
"number": "4976659348270",
"plan": "standard_5000",
"service_status": "LIVE",
"key": { "name": "First message", "scopes": ["messages:read", "messages:send"], "ip_allow": "" },
"limits": { "max_numbers_per_request": 1000, "requests_per_second": 20, "burst": 50, "rate_limit_mode": "enforce", "webhooks_max": 5 }
}service_status خاصو يكون LIVE، وkey.scopes خاصو يعرض الصلاحيات لي محتاجين (ولا * للوصول الكامل). مفتاح sandbox كيبين كذلك "sandbox": true.
GET /v1/YOUR_NUMBER/templates كيعرض الـ templates ديالك. اختار وحدة بـ "status": "APPROVED" و"can_send": true، وانسخ example_request ديالها. ماعندكش حتى template موافَق عليها؟ صاوب وحدة فصفحة Templates ديال dashboard، ولا شوف صيفط إشعارات الطلبات والمواعيد باش تصاوبها بالـ API وتوافق عليها.
صيفط الـ template لرقم الموبايل ديالك (ماشي رقم البزنس نفسو: هادا كيجاوب 422 recipient_is_sender). زيد Idempotency-Key: إلا عاودتي بعد timeout، الرسالة ما كتتصيفطش مرتين.
curl -X POST https://api.app2email.com/v1/YOUR_NUMBER/messages \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: first-message-1" \
-d '{
"to": "61412345678",
"type": "template",
"template": {
"name": "order_update",
"language": { "code": "en" },
"components": [
{ "type": "body", "parameters": [
{ "type": "text", "text": "John" },
{ "type": "text", "text": "#1234" }
] }
]
}
}'const res = await fetch("https://api.app2email.com/v1/YOUR_NUMBER/messages", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.API_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": "first-message-1",
},
body: JSON.stringify({
to: "61412345678",
type: "template",
template: {
name: "order_update",
language: { code: "en" },
components: [
{ type: "body", parameters: [{ type: "text", text: "John" }, { type: "text", text: "#1234" }] },
],
},
}),
});
const sent = await res.json();
console.log(res.status, sent.message_id ?? sent.error);res = requests.post(
"https://api.app2email.com/v1/YOUR_NUMBER/messages",
headers={"Authorization": f"Bearer {os.environ['API_KEY']}", "Idempotency-Key": "first-message-1"},
json={
"to": "61412345678",
"type": "template",
"template": {
"name": "order_update",
"language": {"code": "en"},
"components": [
{"type": "body", "parameters": [{"type": "text", "text": "John"}, {"type": "text", "text": "#1234"}]}
],
},
},
timeout=10,
)
sent = res.json()
print(res.status_code, sent.get("message_id") or sent.get("error"))استعمل اسم الـ template ديالك، ولغتها، وقيمها (example_request فيه كلشي). شنو كتاخد (HTTP 200):
{
"success": true,
"request_id": "kxrkf",
"message_id": "wamid.HBgLNjE0MTIzNDU2NzgVAgARGBJTQU1QTEVfVEVTVF9FVkVOVAA=",
"status": "accepted",
"from": "4976659348270",
"to": "61412345678",
"template": { "name": "order_update", "language": "en", "category": "UTILITY" },
"text": "Hi John, your order #1234 has shipped.",
"conversation_url": "https://www.app2email.com/conversation/61412345678_4976659348270_...",
"note": "accepted by WhatsApp. delivery and read status appear in your app2email Activity Log (WhatsApp sent).",
"contacts": [{ "input": "61412345678", "wa_id": "61412345678" }]
}زيد "dry_run": true للـ body باش تشيك على كلشي (قيم الـ template، الرقم، لائحة Do Not Call، الحد الشهري) بلا ما تصيفط. الجواب كيبين الرسالة بالضبط لي غتوصل لـ WhatsApp. ما كيتصيفطش والو، ما كيتسجلش، وما كيتحسبش.
GET /messages/{message_id} (صلاحية messages:read) كيبين فين وصلات الرسالة. شفّر الـ id بـ URL.
curl "https://api.app2email.com/v1/YOUR_NUMBER/messages/wamid.HBgLNjE0MTIzNDU2NzgVAgARGBJTQU1QTEVfVEVTVF9FVkVOVAA%3D" \
-H "Authorization: Bearer YOUR_API_KEY"شنو كتاخد: status هي وحدة من accepted وsent وdelivered وread وfailed وdeleted وqueued وunknown. الخطوات لي ما وصلاتش ليها ما كيبانوش فـ times، وreply كيبان ملي الزبون يجاوب على هاد الرسالة.
{
"success": true,
"request_id": "p4n8w",
"message_id": "wamid.HBgLNjE0MTIzNDU2NzgVAgARGBJTQU1QTEVfVEVTVF9FVkVOVAA=",
"to": "61412345678",
"status": "read",
"sent_by": "api",
"text": "Hi John, your order #1234 has shipped.",
"times": {
"submitted": "2026-11-06T01:00:00Z",
"accepted": "2026-11-06T01:00:01Z",
"sent": "2026-11-06T01:00:02Z",
"delivered": "2026-11-06T01:00:04Z",
"read": "2026-11-06T01:12:40Z"
},
"conversation_url": "https://www.app2email.com/conversation/61412345678_4976659348270_..."
}جاوب على الرسالة فتليفونك. كاينين جوج طرق باش توصل الجواب فالكود ديالك:
GET /v1/YOUR_NUMBER/events?wait=25&types=message.received، بحال فالجزء 1. فرقمك ديالك النداء الأول كيشغّل فيد الأحداث، والأحداث كتتحفظ من بعدها، 72 ساعة. إذن عيطو مرة وحدة بـ after=now قبل ما تصيفط، وخزن cursor.POST /v1/YOUR_NUMBER/webhooks و{"url": "https://your-server.example/webhook"} (صلاحية webhooks:manage)، ولا زيدو فصفحة مفاتيح API تحت Webhooks. من بعد app2email كيصيفط كاع الأحداث كـ POST مُمضى لـ URL ديالك. صاوب chatbot ديال WhatsApp فيه مستقبل كامل مع شيك الإمضاء.الجواب كيجي كـ message.received:
{
"id": "evt_Xq3k9m2Lw8Rt5Yp1Zs01",
"type": "message.received",
"created": "2026-11-06T01:00:00.000Z",
"number": "4976659348270",
"data": {
"message_id": "wamid.HBgLNjE0MTIzNDU2NzgVAgARGBJTQU1QTEVfVEVTVF9FVkVOVAA=",
"from": "61412345678",
"name": "John",
"type": "text",
"text": "Thanks! When will it arrive?",
"conversation_url": "https://www.app2email.com/conversation/61412345678_4976659348270_SAMPLEk3XbQ9rTzP2mW",
"timestamp": "2026-11-06T01:00:00.000Z"
}
}دابا تقدر تجاوب بـ "type": "text"، بحال فالجزء 1، حتى 24 ساعة من آخر رسالة ديال الزبون.
message.status: sent، من بعد delivered، من بعد read ملي تحلها. الرسالة لي فشلات كتجي كـ message.status بـ status: "failed" وobject error، وكذلك كـ message.failed.message.received، والنافذة ديال 24 ساعة كتتفتح للردود الحرة.صيفط كل رسالة مرة وحدة. عطي لكل POST /messages Idempotency-Key خاص بهاد الرسالة، بحال رقم الطلب ديالك والحدث. نفس الطلب بنفس المفتاح فـ 24 ساعة كيرجع ليك الجواب الأول، بالـ header Idempotent-Replayed: true. نفس المفتاح بـ body آخر: 422 idempotency_key_reused.
حيّد الأحداث المكررة بالـ id ديالها. الحدث ممكن يجي مرة أخرى، من GET /events بعد جواب ضايع، ومن webhook بعد محاولة. خزن الـ ids لي عالجتي على الأقل يومين.
شيك على إمضاء الـ webhook. كل حدث ديال webhook عندو X-App2email-Signature: t=<unix seconds>,v1=<hex>: HMAC-SHA256 ديال t ونقطة والـ body الخام، بالسر ديال الـ webhook (whsec_...) كمفتاح. ارفض الأحداث لي ما طابقوش ولا فيهم t قديم.
احترم حد النداءات. كل جواب فيه X-RateLimit-Limit، X-RateLimit-Remaining وX-RateLimit-Reset. فوق الحد كتجيك 429 rate_limited مع Retry-After: استنى هادشي، من بعد عاود. باش تصيفط template وحدة لبزاف د الأرقام، حطهم فنداء وحد عوض نداء لكل واحد.
Templates برا نافذة 24 ساعة. النص الحر كيخدم غير فـ 24 ساعة من آخر رسالة ديال الزبون (app2email كيوقف 15 دقيقة قبل). كل شي آخر خاصو template موافَق عليها.
صيفط غير لناس وافقو. الـ templates التسويقية ما كتتصيفطش لأرقام فلائحة Do Not Call ديالك، والزبون لي كيكتب STOP كيتزاد ليها (contact.opted_out). صيفط حملة تسويقية كتحترم الـ opt-ins كيشرح الموافقة.
خلي المفتاح سري وصغير. المفتاح فالسيرفر، ماشي فصفحة ويب. عطيه غير الصلاحيات لي محتاجها، وسيّر بمفتاح sandbox للتجارب.
| اللي كتشوف | علاش | الحل |
|---|---|---|
429 من POST /v1/account/sandbox | أكثر من 10 مفاتيح sandbox فوريين فالساعة من عنوانك | استنى Retry-After ثانية، ولا كمل بالمفتاح لي عندك (صالح 7 أيام) |
401 missing_api_key، invalid_api_key، api_key_expired، api_key_revoked | ما تصيفطش مفتاح، ولا مفتاح غالط، ولا منتهي (مفتاح sandbox الفوري كيعيش 7 أيام)، ولا متلغي | صيفط Authorization: Bearer YOUR_API_KEY بمفتاح صالح؛ صاوب مفتاح فوري جديد، ولا مفتاح من صفحة مفاتيح API |
403 api_key_number_mismatch | المفتاح ديال رقم آخر غير اللي فـ URL | حط الرقم ديال المفتاح فـ URL. مفتاح sandbox الفوري كيخدم غير على 12025550100 |
400 invalid_number_in_url | الرقم فـ URL ماشي أرقام برمز البلاد | استعمل الرقم كامل، أرقام غير، بلا + |
403 not_in_instant_sandbox | الرقم التجريبي ما عندوش هاد النداء (الـ webhooks مثلا) | استعمل GET /events هنا، ولا مفتاح sandbox لرقمك ديالك |
422 sandbox_recipient | الـ sandbox الفوري كيكتب غير للزبناء الوهميين ديالو | صيفط لـ 12025550101 حتى 12025550105 |
403 plan_not_allowed، service_not_live | ماكاينش باقة مدفوعة، ولا الخدمة موقوفة | اختار باقة؛ الخدمة الموقوفة كترجع شغالة بزر "Go Live" فصفحة Settings |
403 insufficient_scope | المفتاح ما عندوش صلاحية (details.required_scope) | صاوب مفتاح بـ messages:send وmessages:read |
403 sandbox_key | مفتاح sandbox ما يقدرش يدير هادشي (templates، settings، الموافقات) | استعمل مفتاح بلا علامة sandbox لهاد النداء |
404 template_not_found، template_language_not_found | اسم الـ template ولا لغتها غالطين | انسخ الجوج من GET /templates |
422 template_not_approved | Meta ما وافقش على الـ template (دابا) | استنى الموافقة، ولا اختار وحدة بـ can_send: true |
422 template_parameters_invalid، template_parameter_count_mismatch | عدد ولا نوع القيم غالط | صلّحهم من details وexample_request فالخطأ |
422 outside_24h_window | نص حر لشي واحد ما كتبلكش فـ 24 ساعة اللي فاتو | صيفط template موافَق عليها |
422 recipient_is_sender | صيفطتي لرقم البزنس نفسو | صيفط لتليفون آخر |
403 recipient_opted_out | الزبون فلائحة Do Not Call ديالك | ما تصيفطش ليه تسويق |
403 whatsapp_payment_issue | ماكاينش طريقة دفع صالحة فحساب WhatsApp Business ديالك (خطأ Meta 131042) | زيد وحدة فـ WhatsApp Manager تحت Billing and payments |
429 rate_limited | نداءات زايدة بزاف لهاد المفتاح | استنى Retry-After ثانية، من بعد عاود |
GET /events خاوي فرقمك ديالك | فيد الأحداث كيبدا من أول نداء | عيّط مرة وحدة قبل ما تصيفط (after=now)، من بعد صيفط من جديد |
كل جواب فيه request_id. GET /requests/{id} كيبين شنو تسجل ليه فرقمك ديالك، و support@app2email.com كيقدر يلقاه كذلك. كاع الأكواد: Errors.
جاوب الزبناء من الكود ديالك فـ webhook مُمضى، وسلّم لشي واحد.
صاوب template ديال utility، خليها توافق عليها، وتابع كاع التوصيلات.
ربط Claude ولا وكيل آخر برقمك بمفاتيح محدودة وموافقات.
نفس النداءات من workflow بلا كود، بلا ما تصاوب سيرفر.