for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
import json
apiUrl = 'https://qyapi.weixin.qq.com/cgi-bin/message/send'
def send_msg(message, factory):
response = factory.post(apiUrl, data=json.dumps(message.args))
if response['errcode'] != 0:
factory.refreshtoken()
return response['errcode'], response['errmsg']