获取第三方小程序接口调用凭据
接口介绍
该接口用于获取第三方小程序应用的接口调用凭据。第三方小程序应用接口调用凭据 component_access_token 是服务商进行后续授权步骤,以及调用第三方小程序相关接口的必要条件。
注意:
- •每个 component_access_token 有效期是 2 小时,在此期间调用该接口拿到的 component_access_token 不会改变。
- •当 component_access_token 有效期小于 30 分钟的时候,再次请求获取 component_access_token,会生成一个新的 component_access_token,与此同时老的 component_access_token 依然有效。
请求
基本信息
| 基本 |  | 
| HTTP URL | |
| HTTP Method | GET | 
查询参数
| 参数名 | 参数类型 | 是否必须 | 备注 | 
| component_appid | string | 是 | 第三方小程序应用 appid | 
| component_appsecret | string | 是 | 第三方小程序应用 appsecret | 
| component_ticket | string | 是 | 推送的 component_ticket | 
响应
响应体
| 参数名 | 参数类型 | 备注 | 
| component_access_token | string | 第三方小程序应用接口调用凭据 | 
| expires_in | int | 有效期,单位:秒 | 
响应体示例
{ "component_access_token": "ab41d7e03f9cec1c47dc68420ecddef37cf88642f867a7d099bbf1e81a12e43f168d6045eed50faf8d5d54478cd825ba4eacf99f1451ea2ca4f6561a7d284a66cff70d657cf9d9a7f752353b3c92f", "expires_in": 7200 }
错误码
| 错误码 | message | 
| 40001 | 参数错误 | 
| 40003 | 找不到相关第三方小程序应用 | 
| 40037 | 无效的 ticket | 
| 40038 | 无效的 secret | 
| 40045 | 生成 token 失败,请重试 | 
