Created
September 29, 2023 08:44
-
-
Save qzi/97bbf45dd993e3a17969a2c9ba1f6798 to your computer and use it in GitHub Desktop.
wpa_customer_message
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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