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
Accepts application/json, application/x-www-form-urlencoded and multipart/form-data.
| Field | Required | Description |
|---|---|---|
X-App-Code (header) | Yes | Your app's appCode |
mobile | Yes | Phone number |
smsCaptcha | Yes | SMS code |
countryCode | No | Country code, default 86 |
registerIfNew | No | 1 or true: register the number automatically if it is new |
inviteId | No | Inviter 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.messageappears only when this request registered a new user, so you can use it to detect new users.dataalso carries other profile fields; rely on the actual response.
Common errors: 验证码不正确 (wrong code), 用户还未注册 (not registered), 当前账号已停用/锁定/注销,请联系管理员帮忙处理 (account disabled, locked or closed).
Other sign-in methods
| Endpoint | Method | Main fields | Notes |
|---|---|---|---|
/client/login/v1/account | POST | account, password | Account and password. The initial password 123456 cannot be used to sign in |
/client/login/v1/email | POST | email, password | Email and password |
/client/login/v1/forgetPassword | POST | loginType (mobile / email), mobile + smsCaptcha or email + emailCaptcha, newPassword | Verifies the code, then resets the password. The new password cannot be 123456 |
/client/login/v1/logout | GET / POST | Headers X-Auth-Token, X-App-Code | Signs out |
Successful responses have the same shape as phone sign-in.
Token rules
-
tokenis 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
appCodethat issued it and is invalid with any otherappCode. -
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
| Endpoint | Method | Fields | Notes |
|---|---|---|---|
/client/wx/mp/v1/getAppId | GET / POST | Header X-App-Code | Returns the Official Account AppID configured for your app, for building the OAuth URL |
/client/wx/mp/v1/authorize | GET / POST | code (OAuth code), inviteId | Official Account web sign-in; new users are registered automatically |
/client/wx/ma/v1/authorize | POST | code (from wx.login), inviteId | Mini-program sign-in. If the user has no phone bound, returns code=-1001 with openId in data |
/client/wx/ma/v1/bindMobile | POST | openId, code (from getPhoneNumber), inviteId | After -1001, binds the WeChat phone number and signs in |
/client/wx/mp/v1/sign | POST | — | 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
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, withcliUserId,mobile,email,nickname,avatar,statusand more indata. - 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.