最近更新时间:

接口说明

说明
  • 用于获取接口access_token
注意

调用方访问授权后,将返回的授权信息缓存半小时(缓存过期或调用服务时返回401=>access_token不合法或已过期,再重新申请授权),不要每次调用接口都申请一次授权。

基本信息

HTTP URL

/river/Auth/authorize

HTTP Method

POST

权限要求


请求头

参数名称

参数值

Content-Type

application/json

请求参数

字段名

字段说明

字段类型

必填

备注

client_id

申请应用时分配的AppKey

string

Y


client_secret

申请应用时分配的AppSecret

string

Y


grant_type

请求的类型,填写client_credentials

string

Y


timestamp

当前时间戳

bigint

Y


sign

签名

string

Y



请求示例

curl -X POST \
-H "content-type: application/json" \
-d '{
    "client_id": "client_id_test",
    "client_secret": "didi_test_pass",
    "grant_type": "client_credentials",
    "timestamp": 1566733837,
    "sign": "caf7b797305a413a55663787da193fdf"
}' \
http://api.es.xiaojukeji.com/river/Auth/authorize

响应参数

字段名

字段说明

字段类型

备注

access_token

接口获取授权后的access token

string


expires_in

access_token的生命周期,单位是秒数

int


token_type

access_token类型

string


scope

权限范围

string



响应示例

正常示例

{
    "access_token":"5952a463ff5c2272e6340cc9f52a58a880057ac0",
    "expires_in":1800,
    "token_type":"Bearer",
    "scope":"car|selfcar|river_member|river_order|river_invoice|river_company|river_card"
}

异常示例


错误码

通用错误解决方案

版本记录

日期

更新人

更新内容

上线时间

2023.11.14

陈继诗

迁移文档


2023.12.18

陈继诗

请求删除字段phone

2023.12.18