1.0.0 • Published 6 years ago

for-wechat v1.0.0

Weekly downloads
2
License
Apache-2.0
Repository
github
Last release
6 years ago

wechat-api-sdk

let wechat = require("wechat");


/*
自定义token获取途径 如果不设置 就默认向微信获取
wechat.access_token.setTokenFun(function(){
    return "xxxxx"
});

*/
wechat.init({
    appid: "xxxxxxx",
    secret: "xxxxxxxxxx"
});

let official = wechat.officialAccount

let openid = "xxxxxx"
//获取用户信息 api
//official.user.get(openid).then...


// 客服消息api
//let p = official.staff.message("hello world").to(openid).send().then..



// 获取所有模板
//let p = official.template_message.templates().then...


let template_id = "xxxx"
//模板消息api
official.template_message.template(template_id)
.to(openid).andData({name:"zdp"}).send().then(function(res){
    console.log(res)
})
1.0.0

6 years ago