Lingxing
切换旧版

获取 access - token和refresh - token

POST/api/auth-server/oauth/access-token

接口信息

API Path请求协议请求方式令牌桶容量
/api/auth-server/oauth/access-tokenHTTPSPOST100

请求头

标签必填说明类型示例
Content-Type是请求内容类型[string]multipart/form-data

请求参数

appIdstring必填
AppID,在ERP开放接口菜单中获取
appSecretstring必填
AppSecret,在ERP开放接口菜单中获取

请求curl示例

curl --location 'https://openapi.lingxing.com/api/auth-server/oauth/access-token' \
--form 'appId="appId"' \
--form 'appSecret="appSecret"'

返回结果

Json Object

codeinteger必填
状态码
示例 200
msgstring必填
消息提示
dataobject必填
响应数据
隐藏子属性
access_tokenstring必填
access_token,请求令牌token
refresh_tokenstring必填
refresh_token,可以使用它来给access_token延续有效期
expires_instring必填
access_token过期时间
示例  

返回成功示例

{
    "code": "200",
    "msg": "OK",
    "data": {
        "access_token": "4dcaa78e-b52d-4325-bc35-571021bb0787",
        "refresh_token": "da5b5047-e6d1-496c-ab4d-d5425a6a66e4",
        "expires_in": 7199
    }
}

返回失败示例

{
    "code": "2001001",
    "msg": "app not exist",
    "data": null
}