Skip to content

Instantly share code, notes, and snippets.

@qzi
Created September 29, 2023 08:44
Show Gist options
  • Save qzi/97bbf45dd993e3a17969a2c9ba1f6798 to your computer and use it in GitHub Desktop.
Save qzi/97bbf45dd993e3a17969a2c9ba1f6798 to your computer and use it in GitHub Desktop.
wpa_customer_message
var options = {
method: 'POST',
uri: 'https://api.weixin.qq.com/cgi-bin/message/custom/send',
body: {
touser: wxContext.FROM_OPENID,
msgtype: "text",
text: {
content: "Hello World"
}
},
json: true // Automatically stringifies the body to JSON
};
rp(options)
.then(function (parsedBody) {
// POST succeeded...
console.log("https://api.weixin.qq.com/cgi-bin/message/custom/send", parsedBody)
})
.catch(function (err) {
// POST failed...
console.log("https://api.weixin.qq.com/cgi-bin/message/custom/send", err)
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment