javascript - 微信有没有给个人发送消息的接口
阿神
阿神 2017-04-11 10:44:02
0
7
663
阿神
阿神

闭关修行中......

reply all(7)
洪涛

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

Peter_Zhu

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

左手右手慢动作

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

Ty80

客服接口有

PHPzhong

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

洪涛

使用微信企业号

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
阿神

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!