Kimlik Doğrulama
Token Alma & Yenileme

Kimlik Doğrulama

POST/api/public/auth/token
Kullanıcı adı ve şifre ile Bearer token alır.

Request Body

{
  "username": "[email protected]",
  "password": "Sifreniz"
}

Parametreler

AlanTipZorunluAçıklama
usernamestringEvetKullanıcı adı veya e-posta
passwordstringEvetKullanıcı şifresi

Örnek cURL

curl --request POST 'https://public-api.thinkvoice.ai/api/public/auth/token' \
  --header 'Content-Type: application/json'   --data-raw '{
    "username": "[email protected]",
    "password": "Sifreniz"
  }'

Responses

200Başarılı
{
  "token_type": "Bearer",
  "access_token": "<ACCESS_TOKEN>",
  "expires_in": 604800,
  "refresh_token": "<REFRESH_TOKEN>",
  "scope": "ThinkVoice.Public offline_access"
}
401Geçersiz kullanıcı bilgisi
{ "error": "invalid_grant" }

Access token ömrü 7 gündür. Tüm korumalı isteklerde Authorization: Bearer <access_token> header'ı kullanılmalıdır.

Token Yenileme

POST/connect/token
Refresh token ile yeni access token alır.
curl --request POST 'https://public-api.thinkvoice.ai/connect/token' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data-urlencode 'grant_type=refresh_token' \
  --data-urlencode 'client_id=ThinkVoicePublic_App' \
  --data-urlencode 'refresh_token=<REFRESH_TOKEN>'
⚠️

Token süresi dolduğunda yeniden POST /api/public/auth/token ile giriş yapabilirsin.