閉關(guān)修行中......
請(qǐng)問樓主是要發(fā)送什么信息呢?如果是單純的文本信息,推薦使用"客服接口-發(fā)消息",如果是通知類的,題主可以使用"微信模板信息接口".這兩個(gè)接口都可以在知道對(duì)方的openid的情況下進(jìn)行推送信息
你們理解錯(cuò)我意思了,我現(xiàn)在單發(fā)群發(fā)都實(shí)現(xiàn)了,,,,就是群發(fā)圖文消息,用戶點(diǎn)擊圖文消息的時(shí)候跳轉(zhuǎn)到第三方網(wǎng)頁。。。。。
使用微信企業(yè)號(hào)
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
當(dāng)然如果是服務(wù)號(hào)也可以使用模板消息接口
http://mp.weixin.qq.com/wiki/17/304c1885ea66dbedf7dc170d84999a9d.html