云开发使用unicloud,测试小程序发送公众号的模板消息,结果返回43002,如图:
api使用:https://api.weixin.qq.com/cgi-bin/message/wxopen/template/uniform_send
请求参数
data: {
access_token: event.access_token,
touser: event.touser,
mp_template_msg: {
"appid": "wx6d6c98023c4d1f8d ",
"template_id": "6k96nkZNxvCOzeSrsmDgFiWNQw-CWgxxvFAeQFEE0Xk",
"url": "/pages/index/index",
"miniprogram": {
"appid": "wx8fc6e6699393cd20",
"pagepath": "/pages/index/index"
},
"data": {
"first": {
"value": "恭喜您,一笔佣金结算成功",
"color": "#173177"
},
"keyword1": {
"value": "晚风",
"color": "#173177"
},
"keyword2": {
"value": "2017-07-17",
"color": "#173177"
},
"keyword3": {
"value": "佣金分成",
"color": "#173177"
},
"keyword4": {
"value": "消费提成",
"color": "#173177"
},
"keyword5": {
"value": "12.40",
"color": "#173177"
},
"remark": {
"value": "如有疑问,请联系客服。",
"color": "#173177"
}
}
}
},
dataType: 'json'
接口返回如图!