1.1.0 • Published 7 years ago

wxe-api v1.1.0

Weekly downloads
4
License
ISC
Repository
github
Last release
7 years ago

wxe-api

微信企业号API

示例

import WxeApi from 'wxe-api';

const wxeapi = new WxeApi({
  corpId: process.env.WXE_CORPID,
  secret: process.env.WXE_SECRET,
});

const na57 = await wxeapi.getUser('na57');

API

constructor({ corpId, secret, async getToken, async setToken })

构造函数

  • 参数
    • corpId 必须,微信企业号的CorpId;
    • secret 必须,企业号管理组的secret;
    • async getToken AccessToken的缓存方法,默认使用内存缓存;
    • async setToken 从缓存读取AccessToken的方法,默认由内存缓存中读取;

getAuthorizeURL(redirectUri, state)

getToken()

getUserIdByCode(code)

getUser(userid)

getJsApiTicket()

getJsConfig({ debug, jsApiList, url })

getGroupConfig(url)

getContactTicket()

sendMessage(to, message)

sendText(to, agentid, content)

sendNews(to, agentid, articles)

sendTextCard(to, agentid, textcard)

async getTagList()

获取标签列表

  • 返回值

    [
      {"tagid":1,"tagname":"a"},
      {"tagid":2,"tagname":"b"}
     ]

getTag(tagid)

CHANGELOG

1.0.0

  • 加入debug组件,名称:wxe-api:errorwxe-api:info;
  • getTagList 直接返回taglist。(BREAKING CHANGE);
1.1.0

7 years ago

1.0.0

7 years ago

0.3.0

7 years ago

0.2.4

7 years ago

0.2.3

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.0

7 years ago

0.0.1

7 years ago