获取AccessToken

  • 接口描述

    调用该接口,获取 token 授权,token 将作为其他接口的授权凭证。

  • API

/api/open/auth/accessToken
  • 参数格式
POST application/x-www-form-urlencoded
  • 入参
参数名称 类型 是否必填 描述
clientId String 客户端id,由接口提供方提供
username String 接口提供方系统的用户名
password String 接口提供方系统对应的密码
timestamp String 当前时间,格式为“yyyy-MM-dd HH:mm:ss”,与接口提供服务器时差不能相差半小时以上
sign String 签名,生成规则如下:
1. 按照以下顺序将字符串拼接起来
clientSecret+timestamp+clientId+username+password+clientSecret
其中
client_secret 的值是接口提供方分配的,不可对外暴露。
timestamp 与同名入参传值一致。
clientId 与同名入参传值一致。
username 与同名入参传值一致。
password,与同名入参传值一致。
  • 出参
参数名称 类型 是否必填 描述
accessToken String 访问令牌,用于业务接口调用。有效期 24 小时。
refreshToken Long 当 accessToken 过期时,用于刷新 accessToken。
expiresIn Integer accessToken 的有效期,单位:秒,有效期 24 小时
userId Long 接口提供方系统的用户Id
  • 出参示例
{
    "code": 0,
    "data": {
        "expireIn": 0,
        "accessToken": "",
        "refreshToken": "",
        "userId": ""
    },
    "message": "",
    "success": true
}    
Copyright © cmdjh 2023 all right reserved,powered by Gitbook该文章修订时间: 2023-09-13

results matching ""

    No results matching ""