License Check Quota API
Endpoint
GET /api/License/check-quota/{licenseKey}
Açıklama
Belirtilen lisans anahtarı için kalan kota (imza hakkı) bilgisini sorgular.
Kimlik Doğrulama
Bu endpoint public'tir, JWT token gerektirmez. Lisans anahtarı yeterlidir.
Request
Path Parameters
| Parametre | Tip | Zorunlu | Açıklama |
|---|---|---|---|
licenseKey | string | ✅ Evet | Lisans anahtarı (UUID formatında) |
Headers
Yok
Request Body
Yok
Response
Success Response (200 OK)
{
"success": true,
"data": {
"licenseKey": "550e8400-e29b-41d4-a716-446655440000",
"remainingQuota": 1500,
"totalQuota": 2000,
"usedQuota": 500,
"quotaPercentage": 75.0,
"expiryDate": "2025-12-31T23:59:59Z",
"isActive": true,
"organizationName": "Örnek Hastane A.Ş."
},
"message": "Kota bilgisi başarıyla alındı",
"timestamp": "2025-11-26T10:30:00Z"
}
Response Fields
| Alan | Tip | Açıklama |
|---|---|---|
licenseKey | string | Sorgulanan lisans anahtarı |
remainingQuota | integer | Kalan imza hakkı sayısı |
totalQuota | integer | Toplam imza hakkı |
usedQuota | integer | Kullanılan imza hakkı |
quotaPercentage | decimal | Kalan kota yüzdesi (0-100) |
expiryDate | datetime | Lisans bitiş tarihi (ISO 8601) |
isActive | boolean | Lisans aktif mi? |
organizationName | string | Kuruluş adı |
Error Responses
404 Not Found - Lisans Bulunamadı
{
"success": false,
"error": {
"code": "LICENSE_NOT_FOUND",
"message": "Belirtilen lisans anahtarı bulunamadı"
},
"timestamp": "2025-11-26T10:30:00Z"
}
410 Gone - Lisans Süresi Dolmuş
{
"success": false,
"error": {
"code": "LICENSE_EXPIRED",
"message": "Lisans süresi 2025-10-15 tarihinde dolmuştur"
},
"data": {
"expiryDate": "2025-10-15T23:59:59Z",
"daysExpired": 42
},
"timestamp": "2025-11-26T10:30:00Z"
}
403 Forbidden - Lisans Pasif
{
"success": false,
"error": {
"code": "LICENSE_INACTIVE",
"message": "Lisans pasif durumda, lütfen yönetici ile iletişime geçin"
},
"timestamp": "2025-11-26T10:30:00Z"
}
429 Too Many Requests - Kota Bitti
{
"success": false,
"error": {
"code": "QUOTA_EXCEEDED",
"message": "İmza kotanız tükenmiştir"
},
"data": {
"remainingQuota": 0,
"totalQuota": 2000,
"usedQuota": 2000
},
"timestamp": "2025-11-26T10:30:00Z"
}
400 Bad Request - Geçersiz Lisans Format
{
"success": false,
"error": {
"code": "INVALID_LICENSE_KEY",
"message": "Lisans anahtarı geçersiz formatta (UUID bekleniyor)"
},
"timestamp": "2025-11-26T10:30:00Z"
}
Örnek Kullanım
cURL
curl -X GET "https://api.signaport.com/api/License/check-quota/550e8400-e29b-41d4-a716-446655440000"
C# (HttpClient)
using System.Net.Http;
using System.Text.Json;
var client = new HttpClient();
var licenseKey = "550e8400-e29b-41d4-a716-446655440000";
var response = await client.GetAsync($"https://api.signaport.com/api/License/check-quota/{licenseKey}");
if (response.IsSuccessStatusCode)
{
var content = await response.Content.ReadAsStringAsync();
var quotaInfo = JsonSerializer.Deserialize<QuotaResponse>(content);
Console.WriteLine($"Kalan Kota: {quotaInfo.Data.RemainingQuota}");
}
JavaScript (Fetch)
const licenseKey = '550e8400-e29b-41d4-a716-446655440000';
fetch(`https://api.signaport.com/api/License/check-quota/${licenseKey}`)
.then(response => response.json())
.then(data => {
if (data.success) {
console.log(`Kalan Kota: ${data.data.remainingQuota}`);
console.log(`Kota %${data.data.quotaPercentage.toFixed(1)}`);
}
})
.catch(error => console.error('Hata:', error));
Python (requests)
import requests
license_key = "550e8400-e29b-41d4-a716-446655440000"
response = requests.get(f"https://api.signaport.com/api/License/check-quota/{license_key}")
if response.status_code == 200:
data = response.json()
print(f"Kalan Kota: {data['data']['remainingQuota']}")
Notlar
- Bu endpoint rate limit'e tabidir: 10 istek/dakika per lisans anahtarı
- Kota kontrolü imza işleminden önce yapılmalıdır
- Kota bilgisi gerçek zamanlı olarak güncellenir
- Dashboard entegrasyonu için ideal endpoint
- Cache süresi: 30 saniye (aynı lisans için)
İlgili Endpoint'ler
POST /api/License/validate- Lisans doğrulama ve JWT token almaPOST /api/Signature/sign- E-imza atma (kota tüketir)GET /api/License/history/{licenseKey}- Kullanım geçmişi
Değişiklik Geçmişi
| Versiyon | Tarih | Değişiklik |
|---|---|---|
| 1.0 | 2025-01-15 | İlk versiyon |
| 1.1 | 2025-02-20 | organizationName field eklendi |