API Reference مرجع واجهة برمجة التطبيقات
Complete reference documentation for the Watsal API. All endpoints are relative to the Base URL: https://api.watsal.com.
توثيق مرجعي كامل لواجهة وتسال. جميع نقاط النهاية تعتمد على رابط الأساس: https://api.watsal.com.
Messages & Verification الرسائل والتحقق
Manage OTP verifications and retrieval. إدارة إرسال واستقبال أكواد التحقق.
/v1/verify/send
Generates and sends a numeric One-Time Password (OTP) to the specified phone number via WhatsApp. يُنشئ ويرسل رمز تحقق رقمي لمرة واحدة (OTP) إلى رقم الهاتف المحدد عبر واتساب.
Body Parameters معاملات الطلب
| Param المعامل | Type النوع | Description الوصف |
|---|---|---|
| phone * | string | E.164 formatted phone (e.g. +2010...) رقم هاتف بصيغة E.164 (مثل +2010…) |
| length | int | Code length (4-8 digits). Default: 6 طول الرمز (4-8 أرقام). الافتراضي: 6 |
| brand_name | string | Your app name to appear in msg template. اسم تطبيقك ليظهر في قالب الرسالة. |
{
"success": true,
"data": {
"request_id": "req_550e8400-e29b-41d4",
"status": "sent",
"expires_in": 300
}
}
/v1/verify/check
Validates the code provided by the user against the request ID. يتحقق من الرمز الذي أدخله المستخدم مقابل رقم الطلب.
Body Parameters معاملات الطلب
| Param المعامل | Type النوع | Description الوصف |
|---|---|---|
| request_id * | string | ID returned from send endpoint. المعرف المرتجع من نقطة الإرسال. |
| code * | string | The 4-8 digit code user entered. الرمز المكوّن من 4-8 أرقام الذي أدخله المستخدم. |
{
"success": true,
"data": {
"verified": true,
"timestamp": "2023-10-01T12:00:00Z"
}
}
/v1/messages/{id}
Check the current delivery status of any message sent via the API. تحقق من حالة التسليم لأي رسالة تم إرسالها عبر الواجهة.
Path Parameters معاملات المسار
| Param المعامل | Type النوع | Description الوصف |
|---|---|---|
| id * | string | Message ID (req_...) معرف الرسالة (req_...) |
{
"success": true,
"data": {
"id": "req_550e8400",
"status": "delivered",
"timestamp": "2023-10-01T12:05:00Z"
}
}
Notifications الإشعارات
Send transactional alerts and updates. إرسال إشعارات وتنبيهات المعاملات.
/v1/notifications/send
Sends a template-based notification to a user. يرسل إشعارًا مبنيًا على قالب للمستخدم.
Body Parameters معاملات الطلب
| Param المعامل | Type النوع | Description الوصف |
|---|---|---|
| phone * | string | E.164 phone number. رقم هاتف بصيغة E.164. |
| template * | string | Slug of the template (e.g. order_update). الاسم المميز للقالب (مثل order_update). |
| variables | object | Key-value pair for defaults params. كائن يحوي متغيرات القالب. |
{
"success": true,
"data": {
"request_id": "req_8812a",
"status": "queued"
}
}