首页 > 微信有没有给个人发送消息的接口

微信有没有给个人发送消息的接口

在微信的开发文档里只找到了群发的接口(虽然能发给单个用户,但是单日发送量和用户月接收数量都有限制)。
所以想问一下微信是否提供了给单个账户发送消息的接口


有。https://api.weixin.qq.com/cgi-bin/message/custom/send?


微信模板消息可以实现,最近也正好用到这个东西


客服接口有


请问楼主是要发送什么信息呢?如果是单纯的文本信息,推荐使用"客服接口-发消息",如果是通知类的,题主可以使用"微信模板信息接口".这两个接口都可以在知道对方的openid的情况下进行推送信息


使用微信企业号

http://qydev.weixin.qq.com/wiki/index.php?title=%E5%8F%91%E9%80%81%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E
#!/bin/bash
#SCRIPT_NAME:weixin.sh
#zxc337
#email:zhangxiongcai337@gamil.com
 
gettoken() {
    ID='xxxxxxxxxxxxxxxxxxxxxxxxxxxx'
    SECRET='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
    URL="https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=$ID&corpsecret=$SECRET"
    Gtoken=$(/usr/bin/curl -s -G $URL | awk -F\" '{print $4}')
}
gettoken
 
AppID=3
PartyID=2
UserID="$1"
Title="$2"
Msg="$3"
 
text() {
    printf '{\n'
    printf '\t"touser": "'"$UserID"\"",\n"
    printf '\t"toparty": "'"$PartyID"\"",\n"
    printf '\t"msgtype": "text",\n'
    printf '\t"agentid": "'" $AppID "\"",\n"
    printf '\t"text": {\n'
    printf '\t\t"content": "'"$Msg"\""\n"
    printf '\t},\n'
    printf '\t"safe":"0"\n'
    printf '}\n'
}
 
msg_url="https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=$Gtoken"

/usr/bin/curl --data-ascii "$(text)" $msg_url

当然如果是服务号也可以使用模板消息接口

http://mp.weixin.qq.com/wiki/17/304c1885ea66dbedf7dc170d84999a9d.html

你们理解错我意思了,我现在单发群发都实现了,,,,就是群发图文消息,用户点击图文消息的时候跳转到第三方网页。。。。。


注册一个测试的公众号,开放的东西会比较多

【热门文章】
【热门文章】