关于 access_token
access_token 是公众号的全局唯一接口调用凭据,公众号调用各接口时都需使用 access_token。
access_token 的存储至少要保留 512 个字符空间。access_token 的有效期目前为 2 个小时。
接口调用说明
https 请求方式:GET
https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=APPID&secret=APPSECRET
参数
参数 | 是否必须 | 说明 |
---|---|---|
grant_type | Y | 获取access_token填写client_credential |
appid | Y | 第三方用户唯一凭证 |
secret | Y | 第三方用户唯一凭证密钥,即 appsecret |
#代码块
- 方法一 :curl_init() 函数
<?php
$appid = "";
$appsecret =