获取授权access_token

请求地址

https://api.es.xiaojukeji.com/river/Auth/authorize

返回数据格式

JSON

请求方式

POST

是否需要登录

访问授权限制

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

请求参数

名称 类型 必选 描述
client_id string yes 申请应用时分配的AppKey
client_secret string yes 申请应用时分配的AppSecret
grant_type string yes 请求的类型,填写client_credentials
phone string yes 管理员手机号
timestamp bigint yes 当前时间戳
sign string yes 签名

注意事项

sign签名请参照 签名算法

请求示例

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

返回参数说明

返回值字段 字段类型 字段说明
access_token string 接口获取授权后的access token
expires_in int access_token的生命周期,单位是秒数
token_type string access_token类型
scope string 权限范围

返回示例

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

results matching ""

    No results matching ""