获取小程序全局唯一后台接口调用凭据(access_token)。调用绝大多数后台接口时都需使用 access_token,开发者需要进行妥善保存。

1. 请求参数

属性 类型 默认值 必填 说明
grant_type string 固定填写 client_credential
appid string 小程序唯一凭证,即 AppID
secret string 小程序唯一凭证密钥,即 AppSecret

2. 返回值

返回的 JSON 数据包

属性 类型 说明
access_token string 获取到的凭证
expires_in number 凭证有效时间,单位:秒。目前是7200秒之内的值。
errcode number 错误码
errmsg string 错误信息

errcode 的合法值