智读表API文档

获取或者刷新token

基本信息

API前缀:详见简介

Path: /oauth/oauth/token

Method: POST

接口描述:在这个接口中获取到access_token,该参数在其他接口中必传

本平台access_token的有效期时间为1小时,在过期前需要重新获取access_token或者利用refresh_token刷新或者access_token

获取token参数
参数名 备注 示例
username 用户名 demo
password 密码 demo
grant_type 授予类型 password(定值,不可修改)

Postman调用示例:

https://www.smartmetering.top/staticfile/files/pic/105358.png

刷新token参数
参数名 备注 示例
refresh_token 刷新token d99e19f8-ddba-4f8c-a592-bcd6dsdf20c7
grant_type 授予类型 refresh_token(定值,不可修改)

Postman调用示例:

https://www.smartmetering.top/staticfile/files/pic/110617.png

请求参数

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"
}