-
Notifications
You must be signed in to change notification settings - Fork 0
API: user_tokens
luqiuyuan edited this page Dec 10, 2020
·
2 revisions
VERB | PATH | DESC |
---|---|---|
POST | /user_tokens | log a user in |
DELELE | /user_token | log a user out |
{
"credential": {
"email": "[email protected]",
"password": "Ab123456"
}
}
validations
- credential (required)
- email (required)
- password (required)
see view SHOW
STATUS | ERROR TYPE | DESC | EXAMPLE |
---|---|---|---|
created (201) | 创建成功 | ||
bad request (400) | missing_field | 缺少参数 | { "code": "missing_field", "field": "credential:email" } |
invalid_credential | 用户名或密码错误 | { "code": "invalid_credential" } |
see view SHOW
STATUS | ERROR TYPE | DESC | EXAMPLE |
---|---|---|---|
ok (200) | 成功 |
{
"user_token": {
"user_id": 1,
"key": "Due6daUTre",
"expire_in": 2592000,
}
}