python實現發送信息到微信(調用捷易快信接口)


import json
import urllib.request # 需要安裝 urllib 庫
#http://jy.erpit.cn/login
data = {
'secret': '用戶中心可查到',
'app_key': '分組的key',
'template_id': 'lfN7zq4zAV0xnTYyftiBrS1bDj4ClnAD8rcPDwFwHfc',
'url': '',
'data': {
'first': {
'value': '尊貴VIP',
},
'keyword1': {
'value': 'VIP一號',
},
'keyword2': {
'value': '888888888888元',
},
'remark': {
'value': '最土豪',
},
}
}
url = 'http://jy.erpit.cn/api/message/send'
headers = {'content-type': 'application/json'}
response = urllib.request.Request(url, json.dumps(data).encode('UTF-8'), headers)
page = urllib.request.urlopen(response)
html = page.read()
result = json.loads(html)
print(html)


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM