🔑API حالة مفتاح API
This endpoint checks only whether the supplied API key is active.
Send the API key in the Authorization header using the Bearer scheme. Missing, invalid, revoked, and expired keys receive the same generic 401 Unauthorized response.
- 🔹 تتطلب واجهة برمجة التطبيقات هذهمفتاح واجهة برمجة التطبيقاتللمصادقة.
- 🔹 يجب إرسال مفتاح API عبرheaderولم تعد معلمات الاستعلام مستخدمة.
Backend integration examples
Choose your backend language. Every example reads secret credentials only from environment variables.
const response = await fetch("https://api.dinakel.com/api/gateway/v1/api-key/status", {
method: "GET"
headers: {
Authorization: `Bearer ${process.env.DINAKEL_API_KEY}`,
Accept: "application/json"
}
});
const result = await response.json();
if (!response.ok) throw new Error(result.message || "Dinakel request failed");
console.log(result);💡 طلب مثال
GET https://api.dinakel.com/api/gateway/v1/api-key/status
Headers:
Authorization: Bearer <your_api_key>
Only an active, unexpired key receives HTTP 200. Revoked, expired, and unknown keys intentionally receive the same generic 401 response.
🔍 الرد المثالى
{
"status": true,
"statusCode": 200,
"data": {
"apiKeyStatus": "active"
}
}
⚠️ معالجة الأخطاء
قد تقوم واجهة برمجة التطبيقات (API) بإرجاع استجابات الخطأ التالية:
{
"status": false,
"statusCode": 401,
"message": "Unauthorized"
}
401 Unauthorized:رأس api_key مفقود أو غير صالح. تأكد من توفير مفتاح صالح.
{
"status": false,
"statusCode": 401,
"message": "Unauthorized"
}
401 Unauthorized:لم يتم العثور على مفتاح API المقدم. تحقق مرة أخرى من المفتاح وحاول مرة أخرى.
{
"status": false,
"statusCode": 500,
"message": "Internal server error"
}
500 Internal Server Error:حدث خطأ غير متوقع في الخادم. حاول مرة أخرى لاحقًا أو اتصل بالدعم.