微信开发预览接口
2016-11-03 14:22
176 查看
群发消息接口——第1步:预览接口
1.意义:为了防止开发者模式下,每月发送4条消息的限制,从而导致不满意消息的效果现象。
2.代码实现
纯文本
function sendMsgAll(){
//1.获取全局access_token
$access_token = $this->getWxAccessToken();
//2.组装群发预览接口数据 array
$url = "https://api.weixin.qq.com/cgi-bin/message/mass/preview?access_token=".$access_token;
$array =array(
'touser'=> 'oCKD7wXoAmrhBVcVNflyPDEuin8Y', //openid
'text' => array('content' => '旭日养老'), //文本内容
'msgtype' => 'text' //格式
);
//3.将数组转成json格式
$postJson = json_encode ( $array );
//4.调用第三方接口
$res = $this->https_request( $url ,'post', 'json',$postJson);
dump($res);
}
1.意义:为了防止开发者模式下,每月发送4条消息的限制,从而导致不满意消息的效果现象。
2.代码实现
纯文本
function sendMsgAll(){
//1.获取全局access_token
$access_token = $this->getWxAccessToken();
//2.组装群发预览接口数据 array
$url = "https://api.weixin.qq.com/cgi-bin/message/mass/preview?access_token=".$access_token;
$array =array(
'touser'=> 'oCKD7wXoAmrhBVcVNflyPDEuin8Y', //openid
'text' => array('content' => '旭日养老'), //文本内容
'msgtype' => 'text' //格式
);
//3.将数组转成json格式
$postJson = json_encode ( $array );
//4.调用第三方接口
$res = $this->https_request( $url ,'post', 'json',$postJson);
dump($res);
}
相关文章推荐
- C#.net 微信公众账号接口开发
- 微信公众平台消息接口开发(34)微信墙之表白墙/婚礼墙/晚会墙/会议墙/晒单墙/照片墙/历史墙
- 微信公众帐号开发教程第10篇-解析接口中的消息创建时间CreateTime
- 微信公众帐号开发教程第3篇-开发模式启用及接口配置
- .net实现微信公众账号接口开发
- 微信接口开发小记。
- 微信公众帐号开发教程第3篇-开发模式启用及接口配置
- 微信公众帐号开发教程第10篇-解析接口中的消息创建时间CreateTime(10)
- 微信公众帐号开发教程第3篇-开发模式启用及接口配置 (3)
- 如何基于微信开放接口开发企业的微信 CRM?
- 微信公众平台消息接口开发(34)微信墙之表白墙/婚礼墙/晚会墙/会议墙/晒单墙/照片墙/历史墙
- 微信接口开发报错处理
- 微信接口开发报错处理
- 微信公众帐号开发教程第3篇-开发模式启用及接口配置
- 微信公众帐号开发教程第10篇-解析接口中的消息创建时间CreateTime
- [027] 微信公众帐号开发教程第3篇-开发模式启用及接口配置
- 微信公众帐号开发教程第10篇-解析接口中的消息创建时间CreateTime
- C#.net 微信公众账号接口开发
- 微信公众帐号开发教程第3篇-开发模式启用及接口配置
- 微信公众帐号开发教程第3篇-开发模式启用及接口配置 .