ورود اپ (توکن اپ) | مرجع API
← همهٔ بخشهای مرجع · آدرس پایه: https://trendism.ir/api/v3
POST /auth/logout
خروج اپ و باطل کردن نشست فعلی
Sign the app out (revokes the current app session)
دسترسی لازم: هر کلید یا توکن
| نام | نوع | توضیح |
|---|---|---|
Idempotency-Key (header) | string | A unique string (for example a UUID). Replays the stored response for 24 hours. |
پاسخ موفق: 204 بدون بدنه
POST /auth/otp
ارسال کد ورود به شماره موبایل
Send a login code to a phone number
دسترسی لازم: بدون کلید
| نام | نوع | توضیح |
|---|---|---|
Idempotency-Key (header) | string | A unique string (for example a UUID). Replays the stored response for 24 hours. |
| نام | نوع | توضیح |
|---|---|---|
phone * | string |
| نام | نوع | توضیح |
|---|---|---|
object * | string (otp_challenge) | |
challenge_id * | string | |
expires_in * | integer | Seconds |
POST /auth/otp/verify
تأیید کد و دریافت توکن اپ
Verify the code and receive app tokens
دسترسی لازم: بدون کلید
| نام | نوع | توضیح |
|---|---|---|
Idempotency-Key (header) | string | A unique string (for example a UUID). Replays the stored response for 24 hours. |
| نام | نوع | توضیح |
|---|---|---|
challenge_id * | string | |
code * | string | |
device_name | string |
| نام | نوع | توضیح |
|---|---|---|
object * | string (token) | |
token_type * | string (Bearer) | |
access_token * | string | |
expires_in * | integer | Seconds (15 minutes) |
refresh_token * | string | |
refresh_expires_in * | integer | Seconds (60 days) |
user_id * | integer (int64) |
POST /auth/refresh
تمدید توکن (توکن تازهسازی هر بار عوض میشود)
Rotate the refresh token and get a new access token
دسترسی لازم: بدون کلید
| نام | نوع | توضیح |
|---|---|---|
Idempotency-Key (header) | string | A unique string (for example a UUID). Replays the stored response for 24 hours. |
| نام | نوع | توضیح |
|---|---|---|
refresh_token * | string |
| نام | نوع | توضیح |
|---|---|---|
object * | string (token) | |
token_type * | string (Bearer) | |
access_token * | string | |
expires_in * | integer | Seconds (15 minutes) |
refresh_token * | string | |
refresh_expires_in * | integer | Seconds (60 days) |
user_id * | integer (int64) |