boxfish用户认证系统
测试环境部署地址
生产环境部署地址
http(s)//base.boxfish.cn/passbook/
认证接口 /user/auth
请求方式
POST 方法
请求头信息
x-be-product com.boxfishedu.teacher (必须包含 teacher or student )
请求参数
- json
json { "username":"username", "password":"password" }
返回值
- 合法用户
http code 200
{
"id": 7566,
"username": "b@b.cn",
"access_token": "futT9nmvb5",
"score":3801,
"goal":100,
"figure_url":"http://avatars.boxfish.cn/user/-12/figure/1411532427.jpg"
}
- 用户不存在
http code 404
{
"msg": "用户不存在!"
}
- 用户密码不正确
http code 401
{
"msg":"用户密码不正确!"
}
- 用户不合法 用户头信息中 和用户账号类型不匹配
http code 412
{
"msg":"用户不合法"
}
用户信息接口 /user/me
URL参数
- access_token string 必须
请求方式
GET 方法
返回值
- 合法用户
http code 200
{
"id": 7566,
"username": "b@b.cn",
"access_token": "futT9nmvb5",
"score":3801,
"goal":100,
"figure_url":"http://avatars.boxfish.cn/user/-12/figure/1411532427.jpg"
}
- accessToken 不合法
http code 400
{
"msg": "accessToken 不合法!"
}
- 用户不存在
http code 404
{
"msg": "用户不存在!"
}
#### 用户信息接口 /relation/user/{user_id}?access_token={access_token}
URL参数
- user_id Long 必须
- access_token string 必须
请求方式
GET 方法
返回值
- 用户关系合法
http code 200
json { "id": 100000000640, "target": { "id": 1298963, "username": "iosstudent13@bf.cn", "score": 3912, "gold": 2362, "figure_url": "http://avatars.boxfish.cn/user/1298963/figure/1477366527.jpg" } }
- accessToken 不合法
http code 400
{
"msg": "accessToken 不合法!"
}
- accessToken 过期
http code 401
{
"msg": "用户token过期!"
}
- 该用户没有绑定其它用户!
http code 404
{
"msg": "该用户没有绑定其它用户!"
}