🔑API Anahtar Durumu API'si
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.
- 🔹 Bu API bir gerektirirAPI Anahtarıkimlik doğrulama için.
- 🔹 API anahtarı şu yolla gönderilmelidir:headerve sorgu parametreleri artık kullanılmamaktadır.
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);💡 Örnek İstek
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.
🔍 Örnek Yanıt
{
"status": true,
"statusCode": 200,
"data": {
"apiKeyStatus": "active"
}
}
⚠️ Hata İşleme
API aşağıdaki hata yanıtlarını döndürebilir:
{
"status": false,
"statusCode": 401,
"message": "Unauthorized"
}
401 Unauthorized:api_key başlığı eksik veya geçersiz. Geçerli bir anahtarın sağlandığından emin olun.
{
"status": false,
"statusCode": 401,
"message": "Unauthorized"
}
401 Unauthorized:Sağlanan API anahtarı bulunamadı. Anahtarı bir kez daha kontrol edin ve tekrar deneyin.
{
"status": false,
"statusCode": 500,
"message": "Internal server error"
}
500 Internal Server Error:Beklenmeyen bir sunucu hatası oluştu. Daha sonra tekrar deneyin veya destek ekibiyle iletişime geçin.