出现这种错误的原因是,在公众平台网站上,为订阅号提供了每天一条的群发权限,为服务号提供每月(自然月)4条的群发权限。而对于某些具备开发能力的公众号运营者,可以通过高级群发接口,实现更灵活的群发能力。
所以, 最好加 clientmsgid 参数避免重复。
示例
//微信发布
public function wxpublish($media_id, $type, $token) {
$publish_type = $this->_type($type, $media_id);
// 避免存在相同的用 clientmsgid 参数,避免重复推送
//一、群发接口新增 clientmsgid 参数,开发者调用群发接口时可以主动设置 clientmsgid 参数,避免重复推送
$publish_type['clientmsgid'] = "send_tag_3";
$publish_type = json_encode($publish_type);
$access_token = $this->get_auth_access_token($token);
$url = "https://api.weixin.qq.com/cgi-bin/message/mass/sendall?access_token=" . $access_token;
$result = $this->_sendHttps($url, $publish_type, 'post');
$arr = json_decode($result, true);
//dump($arr);exit;
if ($arr['errcode'] == 0) {
return array('status' => true, 'msg' => '消息发布中~');
} else {
return array('status' => false, 'msg' => '消息发布失败');
}
}
返回:
请参阅微信文档
https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1481187827_i0l21