Skip to main content
Capabilities

Sign-in & users

Every sign-in endpoint requires the X-App-Code header. The token returned on success is used for endpoints that require sign-in.

Phone + SMS code sign-in​

POST/client/login/v1/mobile

Accepts application/json, application/x-www-form-urlencoded and multipart/form-data.

FieldRequiredDescription
X-App-Code (header)YesYour app's appCode
mobileYesPhone number
smsCaptchaYesSMS code
countryCodeNoCountry code, default 86
registerIfNewNo1 or true: register the number automatically if it is new
inviteIdNoInviter ID, recorded on automatic registration
curl -s -X POST https://cloud.ifootoo.com/client/login/v1/mobile \
-H 'X-App-Code: <appCode>' \
-d 'mobile=13800000000' -d 'smsCaptcha=1234' -d 'registerIfNew=1'
{
"code": 200,
"msg": "登录成功",
"type": "SUCCESS",
"data": {
"token": "3f6c1e0a9b7d4c2e8f1a0b9c8d7e6f5a",
"cliUserId": 12345,
"appCode": "<appCode>",
"mobile": "13800000000",
"nickname": "…",
"message": "注册成功,用户初始密码为123456,初始密码无法用户登录,只可用于修改密码校验"
}
}
  • data.message appears only when this request registered a new user, so you can use it to detect new users.
  • data also carries other profile fields; rely on the actual response.

Common errors: 验证码不正确 (wrong code), 用户还未注册 (not registered), 当前账号已停用/锁定/注销,请联系管理员帮忙处理 (account disabled, locked or closed).

Other sign-in methods​

EndpointMethodMain fieldsNotes
/client/login/v1/accountPOSTaccount, passwordAccount and password. The initial password 123456 cannot be used to sign in
/client/login/v1/emailPOSTemail, passwordEmail and password
/client/login/v1/forgetPasswordPOSTloginType (mobile / email), mobile + smsCaptcha or email + emailCaptcha, newPasswordVerifies the code, then resets the password. The new password cannot be 123456
/client/login/v1/logoutGET / POSTHeaders X-Auth-Token, X-App-CodeSigns out

Successful responses have the same shape as phone sign-in.

Token rules​

  • token is a 32-character hex string stored by the platform. It is not a JWT and cannot be decoded or validated locally.

  • For endpoints that require sign-in, send both headers:

    X-Auth-Token: <token>
    X-App-Code: <appCode>
  • A token is bound to the appCode that issued it and is invalid with any other appCode.

  • 15-day sliding expiry: every authenticated request resets the expiry to 15 days.

  • An invalid token returns {"code":401,"msg":"找不到认证token,请重新登录","type":"UNAUTHORIZED"}.

WeChat sign-in​

EndpointMethodFieldsNotes
/client/wx/mp/v1/getAppIdGET / POSTHeader X-App-CodeReturns the Official Account AppID configured for your app, for building the OAuth URL
/client/wx/mp/v1/authorizeGET / POSTcode (OAuth code), inviteIdOfficial Account web sign-in; new users are registered automatically
/client/wx/ma/v1/authorizePOSTcode (from wx.login), inviteIdMini-program sign-in. If the user has no phone bound, returns code=-1001 with openId in data
/client/wx/ma/v1/bindMobilePOSTopenId, code (from getPhoneNumber), inviteIdAfter -1001, binds the WeChat phone number and signs in
/client/wx/mp/v1/signPOST—Official Account JS-SDK signature

Configure your Official Account or mini-program in the console first. Otherwise the response is <appCode>未配置微信公众号信息 (WeChat not configured for this app).

Validate a token from your backend​

GET/client/cli/user/v1/get

When your frontend hands a token to your backend, call this endpoint to confirm it and get the user identity:

curl -s https://cloud.ifootoo.com/client/cli/user/v1/get \
-H 'X-Auth-Token: <token>' -H 'X-App-Code: <appCode>'
  • Valid: code=200, with cliUserId, mobile, email, nickname, avatar, status and more in data.
  • Invalid or expired: code=401.
  • The identity comes only from the token; any user ID in the request is ignored.
  • This call also extends the token to 15 days.