Kirish tokenini yangilash
POST
/v2/auth/refresh
const url = 'https://api-admin.billz.ai/v2/auth/refresh';const options = { method: 'POST', headers: { 'platform-id': '7d4a4c38-dd84-4902-b744-0488b80a4c01', 'Content-Type': 'application/json' }, body: '{"refresh_token":"REFRESH_TOKEN"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api-admin.billz.ai/v2/auth/refresh \ --header 'Content-Type: application/json' \ --header 'platform-id: 7d4a4c38-dd84-4902-b744-0488b80a4c01' \ --data '{ "refresh_token": "REFRESH_TOKEN" }'Xato kodlari: 400 — kiruvchi ma’lumotlar validatsiya xatosi; 401, 403, 429, 500 — barcha metodlar uchun umumiy. Tana formatlari va semantikasi: Javob kodlari va xatolar.
Parameters
“Parameters” bo'limiHeader Parameters
“Header Parameters” bo'limiplatform-id
string
Platforma identifikatori. Integratsiyalar uchun statik qiymat ishlatiladi.
Request Bodyrequired
“Request Bodyrequired” bo'limiMedia typeapplication/json
object
refresh_token
required
Bir martalik yangilash tokeni. Bo’sh bo’lsa — 400 invalid_request. Uzunligi cheklangan
string
Example
{ "refresh_token": "REFRESH_TOKEN"}Responses
“Responses” bo'limiMuvaffaqiyatli javob
Media typeapplication/json
object
code
Muvaffaqiyatda 200
integer format: int32
message
Muvaffaqiyatda ‘ok’; xatoda — odam o’qiy oladigan tavsif
string
error
Muvaffaqiyatda null; xatoda — RFC 6749 §5.2 satr kodi
integer format: int32
data
object
token_type
Har doim Bearer
string
access_token
Yangi access-token
string
refresh_token
Yangi refresh-token; chiqarilmagan bo’lsa, mavjud emas
string
expires_in
Kirish tokenining amal qilish muddati, soniyalarda
integer format: int32
refresh_expires_in
Yangilash tokenining amal qilish muddati, soniyalarda; belgilanmagan bo’lsa, mavjud emas
integer format: int32
Examplegenerated
{ "code": 1, "message": "example", "error": 1, "data": { "token_type": "example", "access_token": "example", "refresh_token": "example", "expires_in": 1, "refresh_expires_in": 1 }}