LANYINGDevelopers
Web & Mini ProgramiOSAndroidC++Server API

2 token interface#

2.1 Get ordinary user token by user ID and password#

POST /token/id

Request Header#

ParameterData TypeRequiredDescription
access-tokenstringfalseToken
app_idstringtrueApp ID
group_idint64falseThis field can be set only if access-token is an Admin token, means call this interface as an Admin for this group ID
user_idint64falseThis field can be set only if access-token is a user token, means call this interface as a group member for this user ID

Request Body#

ParameterData TypeRequiredDefaultDescription
device_guidstringfalseDevice ID, if set, returns PushToken
passwordstringtruePassword
user_idint64trueUser ID, for login by user ID only

Response Body#

● 200 Response data format:JSON

ParameterTypeDescription
codeint32Response code; 200 indicates success
dataobjectResult data
⇥ access_key_secretstringFile key
⇥ encrypt_typeint32Whether to enable encrypted connection
⇥ expireint64Expiration timestamp
⇥ public_keystringPublic key
⇥ push_tokenstringPush Token
⇥ store_tokenstringFile token
⇥ tokenstringAccess token, The access-token when calling the API
⇥ user_idint64User ID
messagestringError information, null means success

Interface Description#

2.2 Get ordinary user token by username/mobile number/email#

POST /token/login

Request Header#

ParameterData TypeRequiredDescription
access-tokenstringfalseToken
app_idstringtrueApp ID
group_idint64falseThis field can be set only if access-token is an Admin token, means call this interface as an Admin for this group ID
user_idint64falseThis field can be set only if access-token is a user token, means call this interface as a group member for this user ID

Request Body#

ParameterData TypeRequiredDefaultDescription
device_guidstringfalseDevice ID, if set, returns PushToken
login_namestringtrueLogin name, which can be mobile number, email, username
passwordstringtruePassword

Response Body#

● 200 Response data format:JSON

ParameterTypeDescription
codeint32Response code; 200 indicates success
dataobjectResult data
⇥ access_key_secretstringFile key
⇥ encrypt_typeint32Whether to enable encrypted connection
⇥ expireint64Expiration timestamp
⇥ public_keystringPublic key
⇥ push_tokenstringPush Token
⇥ store_tokenstringFile token
⇥ tokenstringAccess token, The access-token when calling the API
⇥ user_idint64User ID
messagestringError information, null means success

Interface Description#

2.3 Get ordinary user token by username and password#

POST /token/user

Request Header#

ParameterData TypeRequiredDescription
access-tokenstringfalseToken
app_idstringtrueApp ID
group_idint64falseThis field can be set only if access-token is an Admin token, means call this interface as an Admin for this group ID
user_idint64falseThis field can be set only if access-token is a user token, means call this interface as a group member for this user ID

Request Body#

ParameterData TypeRequiredDefaultDescription
device_guidstringfalseDevice ID, if set, returns PushToken
namestringtrueUsername, for login by username only
passwordstringtruePassword

Response Body#

● 200 Response data format:JSON

ParameterTypeDescription
codeint32Response code; 200 indicates success
dataobjectResult data
⇥ access_key_secretstringFile key
⇥ encrypt_typeint32Whether to enable encrypted connection
⇥ expireint64Expiration timestamp
⇥ public_keystringPublic key
⇥ push_tokenstringPush Token
⇥ store_tokenstringFile token
⇥ tokenstringAccess token, The access-token when calling the API
⇥ user_idint64User ID
messagestringError information, null means success

Interface Description#

Generated API content with concise AI notes where context helps.