获取小程序二维码提示api unauthorized rid,是否需要申请相关权限?
通过PHP代码生成小程序动态参数二维码均提示:api unauthorized rid,以下接口均有尝试: https://api.weixin.qq.com/wxa/getwxacode?access_token=ACCESS_TOKEN
https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=ACCESS_TOKEN
https://api.weixin.qq.com/cgi-bin/wxaapp/createwxaqrcode?access_token=ACCESS_TOKEN
app id:wxc9b88fa8e9fd1bdd,请求参数如下:
$url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=$publicAppId&secret=$publicKey";
$weix = file_get_contents($url);//获得网页输出
$obj=json_decode($weix,true );//解码
$access_token= $obj['access_token'];//网页授权接口调用凭证
$url = "https://api.weixin.qq.com/cgi-bin/wxaapp/createwxaqrcode?access_token=$access_token";
$data = json_encode(['scene' => "hid=2",'page'=>"pages/house/house"]);
响应如下:
{"errcode":48001,"errmsg":"api unauthorized rid: 64892360-67769258-194abcc6"}