找回密码
 立即注册

用微信发送自定义通知

[复制链接]
69伙伴 发表于 2021-1-11 09:06:26 | 显示全部楼层 |阅读模式

微信公众平台接口测试帐号申请
https://mp.weixin.qq.com/debug/cgi-bin/sandbox?t=sandbox/login

调试工具
https://mp.weixin.qq.com/debug

公众号开发文档
https://developers.weixin.qq.com ... arted/Overview.html

8.jpg

用法简单介绍
1.获取 access_token    方法:GET   (token 有效时间2小时,用一次算一次 日2000次应该用不完)
  1. https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=【appid】&secret=【appsecret】
复制代码


2. 获取公众号内的用户OPenID  方法:GET (只需要手动获取一次就行,这是公众号内唯一的)
  1. https://api.weixin.qq.com/cgi-bin/user/get?access_token=【步骤1获取的token】&next_openid=
复制代码


3.发送消息  方法:POST
  1. https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=【步骤1获取的token】


  2. Post Data 内容 json格式

  3. {
  4.     "touser": "【步骤2获取的OpenID】",
  5.     "msgtype": "text",
  6.     "text": {
  7.         "content": "Hello World"
  8.     }
  9. }

复制代码


主要使用接口有
获取access_token
获取用户列表
客服接口-发消息




临时交流 ⇨点我留言
【附件·直下】非必要·勿注册

网格·联系我们 ( 京ICP备16001788号|京公网安备 11010502049360号 ) | 网站地图 | 2012- WGPro.CoM |

GMT+8, 2024-3-29 07:16

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表