الرئيسية الرؤى من نحن اتصل بنا ابدأ الآن
DEVELOPER API

مرجع واجهة برمجة التطبيقات

قم ببناء تكاملات قوية مع واتساب باستخدام مجموعة واجهات برمجة التطبيقات الخاصة بنا. قم بتوسيع اتصالات عملك برمجياً.

مقدمة

يتم تنظيم واجهة برمجة تطبيقات ZapArabia حول REST. تتميز واجهة برمجة التطبيقات الخاصة بنا بعناوين URL يمكن التنبؤ بها والموجهة نحو الموارد، وتقبل أجسام الطلبات المشفرة بالنماذج، وتعيد استجابات مشفرة بتنسيق JSON، وتستخدم رموز استجابة HTTP القياسية والمصادقة والأفعال.

المصادقة

تستخدم واجهة برمجة تطبيقات ZapArabia مفاتيح API للمصادقة على الطلبات. يمكنك عرض وإدارة مفاتيح API الخاصة بك في لوحة تحكم ZapArabia.

المراسلة

أرسل الرسائل إلى عملائك باستخدام تنسيقات متنوعة بما في ذلك النصوص والوسائط والقوالب التفاعلية.

POST /v1/messages/send

Send a message to a contact.

REQUEST
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!"
  }
}'
RESPONSE (200 OK)
{
  "status": "success",
  "data": {
    "id": "msg_987654321",
    "to": "+1234567890",
    "type": "text",
    "timestamp": "2026-04-29T17:15:36.451Z"
  }
}

جهات الاتصال

إدارة قاعدة بيانات عملائك، ومزامنة جهات الاتصال، وتتبع سمات العملاء.

GET /v1/contacts

Retrieve a list of your contacts.

REQUEST
curl -X GET https://api.zaparabia.com/v1/contacts \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  
RESPONSE (200 OK)
{
  "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)

اشترك في الأحداث الفورية مثل الرسائل الواردة وتقارير التسليم وتغييرات الحالة.

POST /v1/webhooks/subscribe

Subscribe to a new event.

REQUEST
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"
  ]
}'
RESPONSE (200 OK)
{
  "status": "success",
  "data": {
    "id": "sub_987654321",
    "events": [
      "message.received",
      "message.sent"
    ],
    "created_at": "2026-04-29T17:15:36.451Z"
  }
}

الإحصائيات

راقب أداء المراسلة ومعدلات التسليم واستخدام المنصة مع تحليلات دقيقة.

GET /v1/stats/overview

Get aggregate messaging performance metrics for the last 30 days.

REQUEST
curl -X GET https://api.zaparabia.com/v1/stats/overview \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  
RESPONSE (200 OK)
{
  "status": "success",
  "data": {
    "messages_sent": 12540,
    "messages_delivered": 12480,
    "delivery_rate": "99.5%",
    "open_rate": "82.4%",
    "average_response_time": "45s"
  }
}
GET /v1/stats/usage

Track your current plan usage and message quotas.

REQUEST
curl -X GET https://api.zaparabia.com/v1/stats/usage \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  
RESPONSE (200 OK)
{
  "status": "success",
  "data": {
    "plan": "enterprise",
    "quota_limit": 100000,
    "quota_used": 12540,
    "reset_date": "2026-05-01"
  }
}

القوالب

الوصول إلى قوالب رسائل واتساب المعتمدة مسبقاً وإدارتها للتواصل عالي التحويل.

GET /v1/templates

Retrieve all approved WhatsApp message templates.

REQUEST
curl -X GET https://api.zaparabia.com/v1/templates \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  
RESPONSE (200 OK)
{
  "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.

ERROR General Error Structure

All error responses follow this standard structure when a request cannot be completed.

REQUEST
# This is a conceptual error format
# No curl command available
RESPONSE (200 OK)
{
  "status": "error",
  "error": {
    "code": "unauthorized",
    "message": "Invalid API key provided.",
    "request_id": "req_987654321"
  }
}