Giter VIP home page Giter VIP logo

wechat-api's Introduction

Wechat API

微信公共平台API。

模块状态

  • NPM version
  • Build Status
  • Dependencies Status
  • Coverage Status

功能列表

  • 发送客服消息(文本、图片、语音、视频、音乐、图文)
  • 菜单操作(查询、创建、删除)
  • 二维码(创建临时、永久二维码,查看二维码URL)
  • 分组操作(查询、创建、修改、移动用户到分组)
  • 用户信息(查询用户基本信息、获取关注者列表)
  • 媒体文件(上传、获取)
  • 群发消息(文本、图片、语音、视频、图文)
  • 客服记录(查询客服记录,查看客服、查看在线客服)
  • 群发消息
  • 公众号支付(发货通知、订单查询)
  • 微信小店(商品管理、库存管理、邮费模板管理、分组管理、货架管理、订单管理、功能接口)
  • 模版消息
  • 网址缩短
  • 语义查询
  • 数据分析
  • JSSDK服务端支持
  • 素材管理
  • 摇一摇周边

详细参见API文档

企业版本请前往:https://github.com/node-webot/wechat-enterprise

Installation

$ npm install wechat-api

Usage

var WechatAPI = require('wechat-api');

var api = new WechatAPI(appid, appsecret);
api.updateRemark('open_id', 'remarked', function (err, data, res) {
  // TODO
});

多进程

当多进程时,token需要全局维护,以下为保存token的接口。

var WechatAPI = require('wechat-api');
var api = new WechatAPI('appid', 'secret', function (callback) {
  // 传入一个获取全局token的方法
  fs.readFile('access_token.txt', 'utf8', function (err, txt) {
    if (err) {return callback(err);}
    callback(null, JSON.parse(txt));
  });
}, function (token, callback) {
  // 请将token存储到全局,跨进程、跨机器级别的全局,比如写到数据库、redis等
  // 这样才能在cluster模式及多机情况下使用,以下为写入到文件的示例
  fs.writeFile('access_token.txt', JSON.stringify(token), callback);
});

Show cases

Node.js API自动回复

Node.js API自动回复机器人

欢迎关注。

代码:https://github.com/JacksonTian/api-doc-service

你可以在CloudFoundryappfogBAE等搭建自己的机器人。

详细API

原始API文档请参见:消息接口指南

License

The MIT license.

交流群

QQ群:157964097,使用疑问,开发,贡献代码请加群。

感谢

感谢以下贡献者:


 project  : wechat-api
 repo age : 1 year, 9 months
 active   : 97 days
 commits  : 211
 files    : 72
 authors  :
   136  Jackson Tian       64.5%
    10  tedyyu             4.7%
     9  greenkeeperio-bot  4.3%
     7  Limjoe             3.3%
     6  Guan Bo            2.8%
     5  SunLn              2.4%
     4  shuhankuang        1.9%
     4  Lou                 Lin   1.9%
     3  minxianlong        1.4%
     2  Colt Xie           0.9%
     2  xuming314          0.9%
     1  brucewar           0.5%
     1  dan                0.5%
     1  ifeiteng           0.5%
     1  kai_hao            0.5%
     1  liuxiaodong        0.5%
     1  looping            0.5%
     1  simonyan           0.5%
     1  wuxq               0.5%
     1  wxhuang            0.5%
     1  xumian.wei         0.5%
     1  yelo               0.5%
     1  BeeSui             0.5%
     1  yuyuan             0.5%
     1  Eric               0.5%
     1  Ezios              0.5%
     1  JaydanHuang        0.5%
     1  Lin@Cloud+         0.5%
     1  Monson Shao        0.5%
     1  Qun Lin            0.5%
     1  Silver Lao         0.5%
     1  Table              0.5%
     1  Wang Yitong        0.5%
     1  Will               0.5%

捐赠

如果您觉得Wechat对您有帮助,欢迎请作者一杯咖啡

捐赠wechat

或者

wechat-api's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.