使用咱们官方提供的php V3接口,调取用户的unionid时,报以下错误
{"code":"INVALID_REQUEST","message":"UnionID为空"}
请求示例数据
// 构造一个 APIv3 客户端实例
$instance = Builder::factory([
'mchid' => $merchantId,
'serial' => $merchantCertificateSerial,
'privateKey' => $merchantPrivateKeyInstance,
'certs' => [
$platformCertificateSerial => $platformPublicKeyInstance,
],
]);
$resp = $instance->chain('v3/facemch/users/9502ca24-d7e2-48d7-812f-ee6512cfa591_rt1')
->get(
['query' =>
[
'info_type' => 'ASK_UNIONID',
'appid' => 'wx111283e02891dbe9',//服务商公众号
'sub_mchid' => '1586753301',//子商户号
]
]
);