官方文档
https://wxpusher.zjiecode.com/docs/#/
官方管理后台
[demo 演示程序
你可以访问演示程序,体验功能:https://wxpusher.zjiecode.com/demo/
演示程序源代码:
https://github.com/wxpusher/wxpusher-sdk-java/
管理后台:
https://wxpusher.zjiecode.com/admin/
实战流程
1、拿到wxpusher的API_token
2、关注wxpusher
3、拿到用户的UIDs
4、python代码
json消息内容
{
"appToken":"AT_1J********************LHZXYS",
"content":"这里是内容",
"summary":"这里是标题",
"contentType":1,
"uids":[
"UID_tY63Pv********************oe"
],
"url":"http://wxpusher.zjiecode.com"
}
post网站:https://wxpusher.zjiecode.com/api/send/message
import requests
import json
# 定义要发送的JSON数据
data = {
"appToken":"AT_1J********************LHZXYS",
"content":"这里是内容",
"summary":"这里是标题",
"contentType":1,
"uids":[
"UID_tY63Pv********************oe"
],
"url":"http://wxpusher.zjiecode.com"
}
# 将数据转换为JSON格式
headers = {
'Content-Type': 'application/json'
}
try:
# 发送POST请求
response = requests.post('https://wxpusher.zjiecode.com/api/send/message', headers=headers, data=json.dumps(data))
# 检查响应状态码
if response.status_code == 200:
print("消息发送成功:", response.json())
else:
print("消息发送失败:", response.status_code, response.text)
except requests.exceptions.RequestException as e:
print("请求异常:", e)