مرجع واجهة برمجة التطبيقات
قم ببناء تكاملات قوية مع واتساب باستخدام مجموعة واجهات برمجة التطبيقات الخاصة بنا. قم بتوسيع اتصالات عملك برمجياً.
مقدمة
يتم تنظيم واجهة برمجة تطبيقات ZapArabia حول REST. تتميز واجهة برمجة التطبيقات الخاصة بنا بعناوين URL يمكن التنبؤ بها والموجهة نحو الموارد، وتقبل أجسام الطلبات المشفرة بالنماذج، وتعيد استجابات مشفرة بتنسيق JSON، وتستخدم رموز استجابة HTTP القياسية والمصادقة والأفعال.
المصادقة
تستخدم واجهة برمجة تطبيقات ZapArabia مفاتيح API للمصادقة على الطلبات. يمكنك عرض وإدارة مفاتيح API الخاصة بك في لوحة تحكم ZapArabia.
المراسلة
أرسل الرسائل إلى عملائك باستخدام تنسيقات متنوعة بما في ذلك النصوص والوسائط والقوالب التفاعلية.
/v1/messages/sendSend a message to a contact.
curl -X POST https://api.zaparabia.com/v1/messages/send \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "+1234567890",
"type": "text",
"text": {
"body": "Hello from ZapArabia!"
}
}'{
"status": "success",
"data": {
"id": "msg_987654321",
"to": "+1234567890",
"type": "text",
"timestamp": "2026-04-29T17:15:36.451Z"
}
}جهات الاتصال
إدارة قاعدة بيانات عملائك، ومزامنة جهات الاتصال، وتتبع سمات العملاء.
/v1/contactsRetrieve a list of your contacts.
curl -X GET https://api.zaparabia.com/v1/contacts \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
{
"status": "success",
"data": [
{
"id": "cnt_1",
"name": "Ahmad Abdullah",
"phone": "+971501234567",
"tags": [
"vip",
"dubai"
]
},
{
"id": "cnt_2",
"name": "Sarah Al-Sayed",
"phone": "+966509876543",
"tags": [
"lead"
]
}
],
"meta": {
"total": 2,
"limit": 10,
"offset": 0
}
}خطافات الويب (Webhooks)
اشترك في الأحداث الفورية مثل الرسائل الواردة وتقارير التسليم وتغييرات الحالة.
/v1/webhooks/subscribeSubscribe to a new event.
curl -X POST https://api.zaparabia.com/v1/webhooks/subscribe \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://your-server.com/webhook",
"events": [
"message.received",
"message.sent"
]
}'{
"status": "success",
"data": {
"id": "sub_987654321",
"events": [
"message.received",
"message.sent"
],
"created_at": "2026-04-29T17:15:36.451Z"
}
}الإحصائيات
راقب أداء المراسلة ومعدلات التسليم واستخدام المنصة مع تحليلات دقيقة.
/v1/stats/overviewGet aggregate messaging performance metrics for the last 30 days.
curl -X GET https://api.zaparabia.com/v1/stats/overview \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
{
"status": "success",
"data": {
"messages_sent": 12540,
"messages_delivered": 12480,
"delivery_rate": "99.5%",
"open_rate": "82.4%",
"average_response_time": "45s"
}
}/v1/stats/usageTrack your current plan usage and message quotas.
curl -X GET https://api.zaparabia.com/v1/stats/usage \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
{
"status": "success",
"data": {
"plan": "enterprise",
"quota_limit": 100000,
"quota_used": 12540,
"reset_date": "2026-05-01"
}
}القوالب
الوصول إلى قوالب رسائل واتساب المعتمدة مسبقاً وإدارتها للتواصل عالي التحويل.
/v1/templatesRetrieve all approved WhatsApp message templates.
curl -X GET https://api.zaparabia.com/v1/templates \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
{
"status": "success",
"data": [
{
"id": "temp_welcome_01",
"name": "welcome_message",
"language": "ar",
"status": "APPROVED",
"category": "UTILITY",
"components": [
{
"type": "BODY",
"text": "أهلاً بك في ZapArabia! كيف يمكننا مساعدتك اليوم؟"
}
]
}
]
}Errors
The ZapArabia API uses standard HTTP status codes to indicate the success or failure of an API request. In general: 2xx indicates success, 4xx indicates an error that failed given the information provided (e.g., a required parameter was omitted, a charge failed, etc.), and 5xx indicates an error with our servers.
General Error StructureAll error responses follow this standard structure when a request cannot be completed.
# This is a conceptual error format
# No curl command available{
"status": "error",
"error": {
"code": "unauthorized",
"message": "Invalid API key provided.",
"request_id": "req_987654321"
}
}