$obj = new \wechat\Wechat();
$obj->official()->subscribe()->category();
成功结果:
array(1) {
[0] => array(2) {
["id"] => int(616)
["name"] => string(6) "公交"
}
}
$obj = new \wechat\Wechat();
$obj->official()->subscribe()->template([
"ids" => "2,616",
"start" => 0,
"limit": => 1
]);
成功结果:
array(4) {
["errcode"] => int(0)
["errmsg"] => string(2) "ok"
["count"] => int(55)
["data"] => array(1) {
[0] => array(4) {
["tid"] => int(99)
["title"] => string(18) "付款成功通知"
["type"] => int(2)
["categoryId"] => string(3) "616"
}
}
}
$obj = new \wechat\Wechat();
$obj->official()->subscribe()->keys([
"tid" => "99"
]);
成功结果:
array(1) {
[0] => array(4) {
["kid"] => int(1)
["name"] => string(12) "物品名称"
["example"] => string(6) "名称"
["rule"] => string(5) "thing"
}
}
$obj = new \wechat\Wechat();
$obj->official()->subscribe()->template_private();
成功结果:
array(1) {
[0] => array(5) {
["priTmplId"] => string(43) "9Aw5ZV1j9xdWTFEkqCpZ7mIBbSC34khK55OtzUPl0rU"
["title"] => string(18) "报名结果通知"
["content"] => string(57) "会议时间:{{date2.DATA}} 会议地点:{{thing1.DATA}}"
["example"] => string(55) "会议时间:2016年8月8日 会议地点:TIT会议室"
["type"] => int(2)
}
}
$obj = new \wechat\Wechat();
$obj->official()->subscribe()->create([
"tid" => "401",
"kidList" => [1,2],
"sceneDesc" => "测试数据"
]);
成功结果:
9Aw5ZV1j9xdWTFEkqCpZ7jWySL7aGN6rQom4gXINfJs
$obj = new \wechat\Wechat();
// false.失败 true.成功
$obj->official()->subscribe()->delete([
"priTmplId" => "wDYzYZVxobJivW9oMpSCpuvACOfJXQIoKUm0PY397Tc"
]);
$obj = new \wechat\Wechat();
// false.失败 true.成功
$obj->official()->subscribe()->send('{
"touser": "OPENID",
"template_id": "TEMPLATEID",
"page": "mp.weixin.qq.com",
"miniprogram":{
"appid":"APPID",
"pagepath":"index?foo=bar"
},
"data": {
"name1": {
"value": "广州腾讯科技有限公司"
},
"thing8": {
"value": "广州腾讯科技有限公司"
},
"time7": {
"value": "2019年8月8日"
}
}
}');