Docs الوثائق Errors / الأخطاء

Errors الأخطاء

Watsal uses conventional HTTP response codes to indicate the success or failure of an API request. Codes in the 2xx range indicate success. Codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted). Codes in the 5xx range indicate an error with Watsal's servers. تستخدم وتسال رموز استجابة HTTP التقليدية للدلالة على نجاح أو فشل طلبات الواجهة. الرموز في نطاق ‎2xx‎ تعني نجاح الطلب، وفي نطاق ‎4xx‎ تشير إلى خطأ مرتبط بالبيانات المرسلة (مثلاً نقص حقل مطلوب)، وفي نطاق ‎5xx‎ تشير إلى مشكلة في خوادم وتسال.

Common Error Codes أكواد الأخطاء الشائعة

Status الحالة Type النوع Description الوصف
400 validation_error The request was valid HTTP but invalid data (e.g. missing required fields, invalid format). الطلب صحيح من ناحية HTTP لكن البيانات غير صحيحة (مثل نقص الحقول المطلوبة أو تنسيق غير صحيح).
401 unauthorized Authentication failed. Check your API key. فشلت المصادقة. تحقق من مفتاح الـ API.
403 forbidden The API key doesn't have permissions to perform the request. مفتاح الـ API لا يملك الصلاحيات لتنفيذ هذا الطلب.
404 not_found The requested resource could not be found. المورد المطلوب غير موجود.
429 rate_limited Too many requests hit the API too quickly. Slow down your request rate. عدد كبير من الطلبات وصل بسرعة كبيرة. قلل معدل الإرسال.
500 server_error Something went wrong on our end. Please report it if it persists. حدث خطأ في خوادمنا. يرجى الإبلاغ إذا استمر.

Troubleshooting Checklist قائمة تحقق لاستكشاف الأخطاء

  • 1
    Check your API Key تحقق من مفتاح الـ API

    Ensure you are using the correct key for the environment (Sandbox vs Production). Copy it exactly as provided. تأكد من استخدام المفتاح الصحيح للبيئة المناسبة (اختبار أو إنتاج) ونسخه كما هو.

  • 2
    Verify Content-Type تحقق من نوع المحتوى

    Ensure your request has the header Content-Type: application/json if you are sending a JSON body. تأكد أن طلبك يحتوي على الترويسة Content-Type: application/json عند إرسال جسم JSON.

  • 3
    Inspect the Error Message راجع رسالة الخطأ

    The message and details fields in the error response usually tell you exactly which field is invalid. حقولا message و details في استجابة الخطأ غالباً توضحان بالضبط أي حقل غير صالح.