获取凭证令牌接口

接口说明:使用appKey和appSecret获取access_token,access_token的有效期为2小时。建议在本地缓存应用的凭证信息,避免频繁调用该接口。

请求方式:POST(HTTPS)
请求地址:https://api.xinrenxinshi.com/authorize/oauth/token?grant_type=client_credentials&client_secret=sE%25lU%25qLNhSy*kliM%23DO&client_id=appBqX8W4xucHImKCDffJ0Z3JxT8XB3O1
参数说明:

参数 类型 必传(Y/N) 说明
grant_type String Y 授权方式固定值:client_credentials
client_id String Y 应用appKey
client_secret String Y 应用appSecret (发送请求之前使用UTF-8进行URLEncoding处理

返回结果:

参数 类型 必传(Y/N) 说明
access_token String Y 令牌
token_type String Y 令牌类型
expires_in String Y token有效时间,时间单位秒
scope String Y 授权作用域

响应示例:

{
    "access_token": "715ad006-6ca5-4ab3-a910-0fca2752f000",
    "token_type": "bearer",
    "expires_in": 7199,
    "scope": "OPENAPI"
}

异常示例:

如果返回以下异常请检查参数的正确性,并且发送请求之前使用UTF-8进行URLEncoding处理

{
    "error": "invalid_client",
    "error_description": "Bad client credentials"
}
2024 © 企家有道网络技术(北京)有限公司版权所有@京ICP备15035315号 all right reserved,powered by Gitbookupdate by: 2024-01-15 15:26:15

results matching ""

    No results matching ""