وثائق الـ API
دليلك الكامل لربط تطبيقك بنظام Evolution وإرسال رسائل واتساب برمجياً.
كيفية البدء
إنشاء حساب
قم بالتسجيل في المنصة والحصول على مفتاح الـ API الخاص بك من لوحة التحكم.
ربط الجهاز
اربط جهاز الواتساب الخاص بك عبر الـ QR Code داخل لوحة التحكم ليكون جاهزاً لإرسال الرسائل.
بدء الإرسال
استخدم الـ API Key الخاص بك لتنفيذ الطلبات البرمجية الموضحة أدناه بترميز JSON.
المصادقة (Authentication)
يجب إرسال مفتاح الـ API الخاص بك في ترويسة الطلب (Header) كالتالي:
Authorization: Bearer {YOUR_API_KEY}
قاعدة الرابط الأساسية (Base URL): https://evo.muslim-host.com/api/v1
نقاط الوصول (Endpoints)
/get
يُعيد تفاصيل الجهاز وحالته الحالية.
مثال (cURL Examples):
"https://evo.muslim-host.com/api/v1/get" \
-H "Authorization: Bearer {API_KEY}"
/state
يتحقق من حالة الاتصال الحية من السيرفر.
مثال (cURL Examples):
"https://evo.muslim-host.com/api/v1/state" \
-H "Authorization: Bearer {API_KEY}"
/connect
يُعيد رمز الـ QR للمسح بواتساب.
مثال (cURL Examples):
"https://evo.muslim-host.com/api/v1/connect" \
-H "Authorization: Bearer {API_KEY}"
/send-text
يُرسل رسالة نصية لرقم ما.
جسم الطلب (Request Body):
{
"number": "201012345678",
"message": "مرحبا!",
"delay": 0
}
مثال (cURL Examples):
"https://evo.muslim-host.com/api/v1/send-text" \
-H "Authorization: Bearer {API_KEY}" \
-H "Content-Type: application/json" \
-d '{"number":"201012345678","message":"مرحبا!","delay":0}'
/send-media
يُرسل صورة أو فيديو أو ملف عبر رابط.
جسم الطلب (Request Body):
{
"to": "201012345678",
"type": "image",
"mimetype": "image\/jpeg",
"caption": "صورتي",
"url": "https:\/\/...",
"filename": "photo.jpg"
}
مثال (cURL Examples):
"https://evo.muslim-host.com/api/v1/send-media" \
-H "Authorization: Bearer {API_KEY}" \
-H "Content-Type: application/json" \
-d '{"to":"201012345678","type":"image","mimetype":"image/jpeg","caption":"صورتي","url":"https://...","filename":"photo.jpg"}'
/send-audio
يُرسل ملف صوتي كرسالة مسجلة.
جسم الطلب (Request Body):
{
"to": "201012345678",
"url": "https:\/\/...\/audio.mp3"
}
مثال (cURL Examples):
"https://evo.muslim-host.com/api/v1/send-audio" \
-H "Authorization: Bearer {API_KEY}" \
-H "Content-Type: application/json" \
-d '{"to":"201012345678","url":"https://.../audio.mp3"}'
/send-location
يُرسل موقعاً جغرافياً.
جسم الطلب (Request Body):
{
"to": "201012345678",
"name": "موقعي",
"address": "الرياض",
"latitude": 24.688,
"longitude": 46.722
}
مثال (cURL Examples):
"https://evo.muslim-host.com/api/v1/send-location" \
-H "Authorization: Bearer {API_KEY}" \
-H "Content-Type: application/json" \
-d '{"to":"201012345678","name":"موقعي","address":"الرياض","latitude":24.688,"longitude":46.722}'
/send-buttons
يُرسل رسالة تفاعلية بأزرار.
جسم الطلب (Request Body):
{
"number": "201012345678",
"title": "اختر",
"description": "خيار",
"buttons": [
{
"buttonId": "1",
"buttonText": {
"displayText": "خيار 1"
},
"type": 1
}
]
}
مثال (cURL Examples):
"https://evo.muslim-host.com/api/v1/send-buttons" \
-H "Authorization: Bearer {API_KEY}" \
-H "Content-Type: application/json" \
-d '{"number":"201012345678","title":"اختر","description":"خيار","buttons":[{"buttonId":"1","buttonText":{"displayText":"خيار 1"},"type":1}]}'
/set-webhook
يُعدّ رابط الـ Webhook لاستقبال الأحداث.
جسم الطلب (Request Body):
{
"url": "https:\/\/yoursite.com\/webhook",
"events": [
"messages.upsert",
"connection.update"
]
}
مثال (cURL Examples):
"https://evo.muslim-host.com/api/v1/set-webhook" \
-H "Authorization: Bearer {API_KEY}" \
-H "Content-Type: application/json" \
-d '{"url":"https://yoursite.com/webhook","events":["messages.upsert","connection.update"]}'
/get-webhook
يُعيد رابط الـ Webhook المعدّ حالياً.
مثال (cURL Examples):
"https://evo.muslim-host.com/api/v1/get-webhook" \
-H "Authorization: Bearer {API_KEY}"
/fetchAllGroups
يُعيد قائمة بجميع المجموعات المرتبطة.
مثال (cURL Examples):
"https://evo.muslim-host.com/api/v1/fetchAllGroups" \
-H "Authorization: Bearer {API_KEY}"
/logout
يقطع اتصال الجهاز من السيرفر.
مثال (cURL Examples):
"https://evo.muslim-host.com/api/v1/logout" \
-H "Authorization: Bearer {API_KEY}"
هل أنت جاهز لتجربة الـ API؟
سجل الآن واحصل على مفتاح الوصول الخاص بك لتبدأ الربط فوراً.
سجل مجاناً الآن