获取用户令牌
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一定stringpassword一定stringminLength: 1maxLength: 128modestring有效值:
"account""mailbox"默认:
"account"
不接受未知字段。
响应
200 成功回复
application/json
object
access_tokenstringtoken_typestring"Bearer"expires_ininteger3600mailbox_id- 选项 1
integer选项 2null
401 需要登录
application/json
object
detail- 选项 1
string选项 2objectcodestringmessagestring
选项 3array数组元素object
403 无法访问
application/json
object
detail- 选项 1
string选项 2objectcodestringmessagestring
选项 3array数组元素object
404 找不到资源
application/json
object
detail- 选项 1
string选项 2objectcodestringmessagestring
选项 3array数组元素object
409 国家冲突
application/json
object
detail- 选项 1
string选项 2objectcodestringmessagestring
选项 3array数组元素object
422 验证错误
application/json
object
detailarray数组元素objectloc一定array数组元素选项 1string选项 2integermsg一定stringtype一定string
429 请求太多
application/json
object
detail- 选项 1
string选项 2objectcodestringmessagestring
选项 3array数组元素object
503 暂时无法使用
application/json
object
detail- 选项 1
string选项 2objectcodestringmessagestring
选项 3array数组元素object