刷新授权小程序接口调用凭据
接口介绍
该接口用于刷新授权小程序接口调用凭据。当授权小程序的接口调用凭据 authorizer_access_token 失效时,可用刷新令牌 authorizer_refresh_token 获取新的接口调用凭据。
注意:
- •authorizer_refresh_token 有效期 1 个月,且只可使用一次,使用后失效。
- •目前刷新成功后,旧的授权小程序接口调用凭据 authorizer_access_token 和授权小程序刷新令牌 authorizer_refresh_token 就会被清除。
请求
基本信息
| 基本 |  | 
| HTTP URL | |
| HTTP Method | GET | 
查询参数
| 参数名 | 参数类型 | 是否必须 | 备注 | 
| component_appid | string | 是 | 第三方小程序应用 appid | 
| component_access_token | string | 是 | 第三方小程序应用接口调用凭据 | 
| authorizer_refresh_token | string | 是 | 刷新令牌 | 
| grant_type | string | 是 | 固定字符串:app_to_tp_refresh_token | 
响应
响应体
| 参数名 | 参数类型 | 备注 | 
| authorizer_access_token | string | 授权小程序接口调用凭据 | 
| expires_in | int | authorizer_access_token 的有效期,单位:秒 | 
| authorizer_refresh_token | string | 刷新令牌,用于刷新已授权用户的 authorizer_access_token | 
| refresh_expires_in | int | authorizer_refresh_token 的有效期,单位:秒 | 
响应体示例
{ "authorizer_access_token": "08021218466f6f2b4d672f3658783566365448746a7a325679513d3d", "expires_in": 7200, "authorizer_refresh_token": "0740283fdbbc11174807dfcbe9b6b566bc5e7542305b1f0d9cb958eba030488cd1acb22d68a97099843629c77ea21a5cee021a08021218466f6f2b4d672f3658783566365448746a7a3256795133", "refresh_expires_in": 2592000 }
错误码
| 错误码 | message | 
| 40001 | 参数错误 | 
| 40002 | 缺少参数 | 
| 40003 | 找不到相关第三方小程序应用 | 
| 40004 | 找不到相关授权小程序 | 
| 40009 | 第三方小程序应用 component_access_token 已过期 | 
| 40010 | 第三方小程序应用 component_access_token 不正确 | 
| 40021 | 第三方小程序应用 authorizer_refresh_token 不正确或者已过期 | 
| 40040 | 无效的 grant_type | 
| 40045 | 生成 token 失败,请重试 | 
