使用获取二维码接口,报错48001 api unauthorized
appid和secret使用公众号或小程序的都不行
返回:string(67) “{“errcode”:48001,“errmsg”:“api unauthorized hint: [X3DR503560720]”}”
$url = "https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=" . $weixin ->access_token; $data = array ( "scene" => "123" , "page" => "pages/index/index" ); $res = https_request( $url , $data ); var_dump( $res ); function https_request( $url , $data = null) { $curl = curl_init(); curl_setopt( $curl , CURLOPT_URL, $url ); curl_setopt( $curl , CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt( $curl , CURLOPT_SSL_VERIFYHOST, FALSE); if (! empty ( $data )){ curl_setopt( $curl , CURLOPT_POST, 1); curl_setopt( $curl , CURLOPT_POSTFIELDS, $data ); } curl_setopt( $curl , CURLOPT_RETURNTRANSFER, 1); $output = curl_exec( $curl ); curl_close( $curl ); return $output ; } |