跳转到内容
简体中文

获取用户令牌

POST/v1/auth/token

根据登录名和密码发出一小时的访问令牌。指定 mode=account 以访问所有帐户邮箱,或指定 mode=mailbox 以访问一个地址。在 Authorization: Bearer <access_token> 标头中传递 access_token。

授权和访问区域 · 错误和重复

要求

终端窗口
curl -X POST 'https://adapt-mail.com/v1/auth/token' \
-H 'Content-Type: application/json' \
--data '{"login":"user-123","password":"<password>"}'

请求正文 · application/json

object

login一定

string

password一定

string

minLength: 1

maxLength: 128

mode

string

有效值: "account" "mailbox"

默认: "account"

不接受未知字段。

响应

200 成功回复

application/json

object

access_token

string

token_type

string

"Bearer"

expires_in

integer

3600

mailbox_id
选项 1

integer

选项 2

null

401 需要登录

application/json

object

detail
选项 1

string

选项 2

object

code

string

message

string

选项 3

array

数组元素

object

403 无法访问

application/json

object

detail
选项 1

string

选项 2

object

code

string

message

string

选项 3

array

数组元素

object

404 找不到资源

application/json

object

detail
选项 1

string

选项 2

object

code

string

message

string

选项 3

array

数组元素

object

409 国家冲突

application/json

object

detail
选项 1

string

选项 2

object

code

string

message

string

选项 3

array

数组元素

object

422 验证错误

application/json

object

detail

array

数组元素

object

loc一定

array

数组元素
选项 1

string

选项 2

integer

msg一定

string

type一定

string

429 请求太多

application/json

object

detail
选项 1

string

选项 2

object

code

string

message

string

选项 3

array

数组元素

object

503 暂时无法使用

application/json

object

detail
选项 1

string

选项 2

object

code

string

message

string

选项 3

array

数组元素

object