Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

快速开始

API 公共参数

API 涉及的公共请求参数和返回参数如下:

请求参数

参数名类型是否必填说明
Request-Idstring每次请求的唯一ID
AuthorizationstringBearer <token>,JWT token,除获取token接口外必填
Content-Typestring固定值:application/json

返回参数

所有返回均为 JSON 格式,数据结构如下:

参数名类型说明
codestring错误码,SUCCESS为成功
messagestring错误描述
dataobject业务数据

获取 Token

默认 token 有效期为 2 小时。token 过期后,可以重新获取新 token。

  • 请求方法:POST
  • 请求地址:/oauth/api/v1/token

请求参数

参数名类型说明
app_idstring开发者 app ID
app_secretstring开发者 app secret
grant_typestring固定值:client_credentials

返回参数

参数名类型说明
access_tokenstringJWT token
expires_inlong过期时间(秒)
refresh_tokenstring刷新token(可选)
refresh_token_expires_inlong刷新token过期时间(秒)