Coder Social home page Coder Social logo

co-wechat-api's Introduction

Wechat API(ES6版)

微信公共平台API。

模块状态

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

功能列表

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

详细参见API文档

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

Installation

$ npm install co-wechat-api

Usage

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

async function() {
  var api = new WechatAPI(appid, appsecret);
  var result = await api.updateRemark('open_id', 'remarked');
}

多进程

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

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

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  : co-wechat-api
 repo age : 2 years, 5 months
 active   : 31 days
 commits  : 95
 files    : 50
 authors  :
    65  Jackson Tian  68.4%
     7  肥鼠          7.4%
     6  magicxie      6.3%
     3  马剑          3.2%
     2  pillarhou     2.1%
     2  Lei           2.1%
     2  sunwf         2.1%
     2  TimZhang      2.1%
     2  ken           2.1%
     1  ladjzero      1.1%
     1  Jichao Wu     1.1%
     1  HelloYou      1.1%
     1  mukaiu        1.1%

捐赠

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

捐赠wechat

或者

co-wechat-api's People

Contributors

888dazhuang avatar ckken avatar darrenhou1993 avatar helloyou2012 avatar jacksontian avatar ladjzero avatar leim avatar magicxie avatar mukaiu avatar swfbarhr avatar tim-zhang avatar wujichao avatar zousandian avatar

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.