{"id":19035494,"url":"https://github.com/node-webot/wechat-enterprise-api","last_synced_at":"2025-04-23T18:23:01.532Z","repository":{"id":24323719,"uuid":"27720443","full_name":"node-webot/wechat-enterprise-api","owner":"node-webot","description":"Wechat Enterprise API","archived":false,"fork":false,"pushed_at":"2016-05-23T14:20:47.000Z","size":2611,"stargazers_count":63,"open_issues_count":3,"forks_count":28,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-13T22:23:39.823Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/node-webot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-12-08T15:11:16.000Z","updated_at":"2025-04-07T13:30:55.000Z","dependencies_parsed_at":"2022-06-30T00:03:52.067Z","dependency_job_id":null,"html_url":"https://github.com/node-webot/wechat-enterprise-api","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-webot%2Fwechat-enterprise-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-webot%2Fwechat-enterprise-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-webot%2Fwechat-enterprise-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-webot%2Fwechat-enterprise-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/node-webot","download_url":"https://codeload.github.com/node-webot/wechat-enterprise-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250488108,"owners_count":21438718,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T21:50:58.446Z","updated_at":"2025-04-23T18:23:01.499Z","avatar_url":"https://github.com/node-webot.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"wechat enterprise api\n=====================\n\n微信公共平台企业号版主动调用API\n\n## 模块状态\n- [![NPM version](https://badge.fury.io/js/wechat-enterprise-api.png)](http://badge.fury.io/js/wechat-enterprise-api)\n- [![Build Status](https://travis-ci.org/node-webot/wechat-enterprise-api.png?branch=master)](https://travis-ci.org/node-webot/wechat-enterprise-api)\n- [![Dependencies Status](https://david-dm.org/node-webot/wechat-enterprise-api.png)](https://david-dm.org/node-webot/wechat-enterprise-api)\n- [![Coverage Status](https://coveralls.io/repos/node-webot/wechat-enterprise-api/badge.png)](https://coveralls.io/r/node-webot/wechat-enterprise-api)\n\n## 功能列表\n- 主动消息\n- 菜单操作\n- 部门管理\n- 用户管理\n- 标签管理\n- 媒体文件\n- OAuth API（授权、获取基本信息）\n- JS SDK 授权\n- 管理企业号应用\n- 通讯录批量操作接口\n- 永久素材管理接口\n- 企业号摇一摇周边接口\n\n\n## 详细文档\n- [文档主页](http://doxmate.cool/node-webot/wechat-enterprise-api/index.html)\n- [API文档](http://doxmate.cool/node-webot/wechat-enterprise-api/api.html)\n- 代码[测试覆盖率](http://node-webot.github.io/wechat-enterprise-api/coverage/index.html)\n- [新手上路](http://node-webot.github.io/wechat-enterprise-api/Getting%20start.html)\n\n### 通过代理服务器访问\n\n#### 场景\n\n对于大规模的集群部署模式，为了安全和速度，会有一些负载均衡的节点放在内网的服务器上（即负载均衡的节点与主结点通过内网连接，并且内网服务器上没有外网的IP）。这时，就需要配置代理服务器来使内网的机器可以有限度的访问外网的资源。例如：微信套件中的各种主动调用接口。\n\n如何架设代理服务器在这里不做赘述，一般推荐使用squid 3，免费、快速、配置简单。\n\n#### 技术原理\n\n由于需要访问的微信API服务器是https协议，所以普通的http代理模式不能使用。\n而一般都是http协议的代理服务器。\n我们要实现的就是通过http代理通道来走https的请求。\n\n基本的步骤是2步：\n\n- 连接到代理服务器，发送CONNECT命令，打开一个TCP连接。\n- 使用上一步打开的TCP连接，发送https的请求。\n\n#### 实现步骤\n\n一、下载[node-tunnel](https://github.com/koichik/node-tunnel) 注意：npm上的版本较老，不支持node v0.10以上的版本。\n\n二、使用 httpsOverHttp 这个agent。\n\n三、将agent配置给urllib，通过urllib的beforeRequest这个方法。\n\n```js\nvar tunnel = require('tunnel');\n\nvar agent = tunnel.httpsOverHttp({\n  proxy: {\n    host: 'proxy_host_ip',\n    port: 3128\n  }\n});\n\napi.setOpts({\n    beforeRequest:function(options){\n        options.agent = agent;\n    }\n});\n\n```\n\n## Show cases\n### Node.js API自动回复\n\n![Node.js API自动回复机器人](http://nodeapi.diveintonode.org/assets/qrcode.jpg)\n\n欢迎关注。\n\n代码：\u003chttps://github.com/JacksonTian/api-doc-service\u003e\n\n你可以在[CloudFoundry](http://www.cloudfoundry.com/)、[appfog](https://www.appfog.com/)、[BAE](http://developer.baidu.com/wiki/index.php?title=docs/cplat/rt/node.js)等搭建自己的机器人。\n\n## License\nThe MIT license.\n\n## 交流群\nQQ群：157964097，使用疑问，开发，贡献代码请加群。\n\n## 感谢\n感谢以下贡献者：\n\n```\n\n project  : wechat-enterprise-api\n repo age : 7 months\n active   : 20 days\n commits  : 32\n files    : 34\n authors  :\n    18\tJackson Tian            56.2%\n    12\tNick Ma                 37.5%\n     2\tQun Lin                 6.2%\n\n```\n\n## 捐赠\n如果您觉得Wechat企业号版本对您有帮助，欢迎请作者一杯咖啡\n\n![捐赠wechat](https://cloud.githubusercontent.com/assets/327019/2941591/2b9e5e58-d9a7-11e3-9e80-c25aba0a48a1.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnode-webot%2Fwechat-enterprise-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnode-webot%2Fwechat-enterprise-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnode-webot%2Fwechat-enterprise-api/lists"}