API前缀:详见简介
Path: /oauth/oauth/token
Method: POST
接口描述:在这个接口中获取到access_token
,该参数在其他接口中必传
本平台access_token
的有效期时间为1小时,在过期前需要重新获取access_token
或者利用refresh_token
刷新或者access_token
参数名 | 备注 | 示例 |
---|---|---|
username | 用户名 | demo |
password | 密码 | demo |
grant_type | 授予类型 | password(定值,不可修改) |
Postman
调用示例:
参数名 | 备注 | 示例 |
---|---|---|
refresh_token | 刷新token | d99e19f8-ddba-4f8c-a592-bcd6dsdf20c7 |
grant_type | 授予类型 | refresh_token(定值,不可修改) |
Postman
调用示例:
Headers
参数名称 | 参数值 | 是否必须 | 示例 | 备注 |
---|---|---|---|---|
Content-Type | application/x-www-form-urlencoded | 是 |
Body
参数名称 | 参数类型 | 是否必须 | 示例 | 备注 |
---|---|---|---|---|
username | text | 是 | ||
password | text | 是 | ||
grant_type | text | 是 |
{
"access_token":"4e9fdb30-4e34-4f16-bb0d-a865ef61a05a",
"token_type":"bearer",
"refresh_token":"4cd7c1d7-354a-43d7-acdb-d67f04061ae9",
"expires_in":1770,
"scope":"select"
}