收藏
回答

无法获取s_pappid?已经开通电子发票


APPIDwx778804e73c086080

<?php 

获取$access_token正常

url="https://api.weixin.qq.com/card/invoice/seturl?access_token=".$access_token;

   $jsonStr='{}';

   http_post_num($url, $jsonStr) 

 function http_post_num($url, $jsonStr)

    $ch = curl_init();

    $header =array("Content-type:application/json;charset='utf-8'","Accept:application/json");

    curl_setopt($ch, CURLOPT_URL, $url);

    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");

    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);

    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);

    curl_setopt($ch, CURLOPT_HTTPHEADER,$header);

    curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (compatible; MSIE 5.01; Windows NT 5.0)');

    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);

    curl_setopt($ch, CURLOPT_AUTOREFERER, 1);

    curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonStr);

    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

    $response = curl_exec($ch);


      echo $response;

    curl_close($ch);

    

    return $response;

}

?>

{"errcode":48001,"errmsg":"api unauthorized hint: [ng2eIA0962ld64]"} 


回答关注问题邀请回答
收藏

1 个回答

登录 后发表内容
问题标签