POST /login
Kullanıcı adı ve şifre ile sisteme giriş yapar; başarılıysa token döner.
İstek
POST https://kladim.com/api/login
Content-Type: application/json
{
"username": "your-username",
"password": "your-password"
}
Parametreler
| Ad | Tip | Zorunlu | Açıklama | Örnek |
|---|---|---|---|---|
username |
string | Evet | Kullanıcı adı / e-posta | "apiuser" |
password |
string | Evet | Parola | "secret123" |
Başarılı Yanıt
200 OK
{
"token": "eyJhbGciOiJIU... (Bearer token)",
"tokenType": "Bearer",
"expiresIn": 604800,
"expiresAt": "2025-10-31T15:19:07+00:00",
"resellerId": XXXX
}
Hata Yanıtları (örnek)
400 Bad Request
{
"error": { "code": "INVALID_ARGUMENT", "message": "username is required" }
}
401 Unauthorized
{
"error": { "code": "UNAUTHORIZED", "message": "Invalid credentials" }
}
cURL Örneği
curl -X POST "https://kladim.com/api/login" \
-H "Content-Type: application/json" \
-d '{
"username": "apiuser",
"password": "secret123"
}'
Not: Dönen tokenı diğer tüm endpoint çağrılarında Authorization: Bearer <token> şeklinde kullanın.