Python模块系列
Python项目常用的模块代码。
版本
名称 | 版本 |
---|---|
Python | 3 |
描述
企业微信消息通知
腾讯企业微信官网提供一整套WebHook API接口,内容相当丰富,可以实现内部、第三方等各种各样的功能
详情参考reference urls
设计
运用requests模拟API请求,这里主要实现了2大请求:
- ACCESS TOKEN:认证token获取
- SEND MESSAGE:发送消息
使用
1 | qywx_lib = QYWXLib(corp_id=企业号标识, secret=管理组凭证密钥, agent_id=机器人应用ID) |
初始化必须的参数:
- corp_id: 企业号标识
- secret: 管理组凭证密钥
- agent_id: 机器人应用ID
源码
1 | # -*- coding: utf-8 -*- |
官网API教程
- ACCESS TOKEN:https://developer.work.weixin.qq.com/document/path/91039
- 发送应用消息:https://developer.work.weixin.qq.com/document/path/90236
全局错误码:https://developer.work.weixin.qq.com/document/path/90313#10649
1
2
3
4
5
6
7
8
9
10
11企业微信API response:
{
"errcode" : 0,
"errmsg" : "ok",
"invaliduser" : "userid1|userid2",
"invalidparty" : "partyid1|partyid2",
"invalidtag": "tagid1|tagid2",
"unlicenseduser" : "userid3|userid4",
"msgid": "xxxx",
"response_code": "xyzxyz"
}- 发消息API参考:https://developer.work.weixin.qq.com/document/path/90236
- MARKDOWN语法:https://developer.work.weixin.qq.com/document/path/90236#%E6%94%AF%E6%8C%81%E7%9A%84markdown%E8%AF%AD%E6%B3%95
系列
Python模块之command系统命令
Python模块之excel模块
Python模块之logger日志
Python模块之utils公共方法
Python模块之watcher打点
Python模块之config配置解析
Python模块之dtalk钉钉消息
Python模块之企业微信
更多模块请参考文章TAG进行查看。
Python模块系列,持续更新中。。。。。。