1.医生在医生端发送消息给指定患者
2.因为不能通过授权登录来获取openid,所以我们数据库里应该先做好患者的id与openid的关联(比如手机号关联openid)
3.通过 模版消息接口(message/template/send)向患者推送一条通知,需要传递患者的openid作为参数
示例:
API:
api.weixin.qq.com/cgi-bin/message/template/send?access_token=2te-hkFaPqMGwYlfD9TZ5hF7aOdyARhS3A--bX76Gu20ICHCZnO3y12cVWPmIRuxzd4DlbtX-gOnDo2feSkghbpt-fkLMemmMK688Vxq06eOpD7bSMRkVOAiWFLppFTsYJWcAJANYL
(access_token需要用接口获取,有效期7200秒)
POST BODY:
{
"touser": "oUkl6wJUBfkLseShpIG8r04W1RjA",
"template_id": "DLaa9jYozkxoyhg4myvzuH7vjjDSekIrvUewDymQego",
"url": "https://wx.yayi365.cn/personal/per_index.html",
"topcolor": "#FF0000",
"data": {
"first": {
"value": "你有一条医生问询通知消息。",
"color": "#173177"
},
"keyword1": {
"value": "杭州第六医院",
"color": "#173177"
},
"keyword2": {
"value": "龙鸿轩",
"color": "#173177"
},
"remark": {
"value": "点击查看详情",
"color": "#173177"
}
}
}