【请求参数】:{"action_name":"QR_STR_SCENE","expire_seconds":10800,"action_info":{"scene":{"scene_str":"gift_1298439407299280897"}}}
【响应数据】:{"ticket":"gQEw8TwAAAAAAAAAAS5odHRwOi8vd2VpeGluLnFxLmNvbS9xLzAyWkFTcmgyNDRkMjAxTEJ2dzF2Y1gAAgS1taBfAwQwKgAA","expire_seconds":10800,"url":"http:\/\/weixin.qq.com\/q\/02ZASrh244d201LBvw1vcX"}
根据产生的二维码,关注公众号。
{"allFieldsMap":{"CreateTime":"1604367805","EventKey":"","Event":"subscribe","ToUserName":"gh_23f2d6a925d5","FromUserName":"oBERCwMXSsoM612rWNOnPKok14Wk","MsgType":"event"},"createTime":"1604367805","event":"subscribe","eventKey":"","fromUser":"oBERCwMXSsoM612rWNOnPKok14Wk","hardWare":{},"msgType":"event","scanCodeInfo":{},"sendLocationInfo":{},"sendPicsInfo":{"picList":[]},"toUser":"gh_23f2d6a925d5"}
EventKey中的值为空。
我也也到这个问题,我是把获取带参数二维码的 action_name 写成 QR_STR_SCENE,而我的scene_id 是数字,换成 整型参数值 QR_SCENE 就有值了
同问
开发语言:php
$data = [ "action_name" => "QR_LIMIT_SCENE", "action_info" => [ "scene" => [ "scene_str" => "whiteList_".$cmid ] ] ]; $rs = $qr->create($token, json_encode($data));
结果
<xml><ToUserName><![CDATA[xxxxxxxxxxxxxxxxxxxxx]]></ToUserName>
<FromUserName><![CDATA[xxxxxxxxxxxxxxxxxxxxxxxxxxxxx]]></FromUserName>
<CreateTime>1610698264</CreateTime>
<MsgType><![CDATA[event]]></MsgType>
<Event><![CDATA[SCAN]]></Event>
<EventKey><![CDATA[0]]></EventKey>
<Ticket><![CDATA[xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx]]></Ticket>
</xml>
没人,我顶顶。