微信上面wxpusher消息推送的全过程,详细教程

官方文档

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)
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值