پرش به محتوا

ورود اپ (توکن اپ) | مرجع API

← همهٔ بخش‌های مرجع · آدرس پایه: https://trendism.ir/api/v3

POST /auth/logout

خروج اپ و باطل کردن نشست فعلی

Sign the app out (revokes the current app session)

دسترسی لازم: هر کلید یا توکن

پارامترها
نامنوعتوضیح
Idempotency-Key (header) stringA 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) stringA unique string (for example a UUID). Replays the stored response for 24 hours.
بدنهٔ درخواست (OtpRequest)
نامنوعتوضیح
phone *string
پاسخ 201 (OtpChallenge)
نامنوعتوضیح
object *string (otp_challenge)
challenge_id *string
expires_in *integerSeconds

POST /auth/otp/verify

تأیید کد و دریافت توکن اپ

Verify the code and receive app tokens

دسترسی لازم: بدون کلید

پارامترها
نامنوعتوضیح
Idempotency-Key (header) stringA unique string (for example a UUID). Replays the stored response for 24 hours.
بدنهٔ درخواست (OtpVerify)
نامنوعتوضیح
challenge_id *string
code *string
device_name string
پاسخ 201 (TokenPair)
نامنوعتوضیح
object *string (token)
token_type *string (Bearer)
access_token *string
expires_in *integerSeconds (15 minutes)
refresh_token *string
refresh_expires_in *integerSeconds (60 days)
user_id *integer (int64)

POST /auth/refresh

تمدید توکن (توکن تازه‌سازی هر بار عوض می‌شود)

Rotate the refresh token and get a new access token

دسترسی لازم: بدون کلید

پارامترها
نامنوعتوضیح
Idempotency-Key (header) stringA unique string (for example a UUID). Replays the stored response for 24 hours.
بدنهٔ درخواست (RefreshRequest)
نامنوعتوضیح
refresh_token *string
پاسخ 201 (TokenPair)
نامنوعتوضیح
object *string (token)
token_type *string (Bearer)
access_token *string
expires_in *integerSeconds (15 minutes)
refresh_token *string
refresh_expires_in *integerSeconds (60 days)
user_id *integer (int64)