微信群发 clientmsgid exist 45065错误

出现这种错误的原因是,在公众平台网站上,为订阅号提供了每天一条的群发权限,为服务号提供每月(自然月)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

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值