微信API access_token 验证 weixin_authorize https://github.com/lanrion/weixin_authorize
WeixinAuthorize
Installation
Add this line to your application's Gemfile:
gem 'weixin_authorize'
And then execute:
$ bundle
Or install it yourself as:
$ gem install weixin_authorize
Usage
Init a client
$client ||= WeixinAuthorize.configure do |config|
config.app_id = ENV["APPID"]
config.app_secret = ENV["APPSECRET"]
config.expired_at = Time.now.to_i
end
# Or
$client ||= WeixinAuthorize::Client.new(ENV["APPID"], ENV["APPSECRET"])
获取用户管理信息
分组管理接口
-
创建分组:
group = $client.create_group("test")
-
查询所有分组:
groups = $client.groups
-
查询用户所在分组:
group = $client.get_group_for(ENV["OPENID"])
-
修改分组名:
group = $client.update_group_name(ENV["OPENID"], "new_group_name")
-
移动用户分组:
group = $client.update_group_for_openid(ENV["OPENID"], "to_groupid")
自定义菜单
-
response = $client.create_menu(menu)
-
response = $client.menu
-
response = $client.delete_menu
发送客服信息
-
发送文本信息:
$client.send_text_custom(to_user, content)
-
发送图片信息:
$client.send_image_custom(to_user, media_id)
-
发送语音消息:
$client.send_voice_custom(to_user, media_id)
-
发送视频消息:
$client.send_video_custom(to_user, media_id, options)
-
发送音乐消息:
$client.send_music_custom(to_user, media_id, musicurl, hqmusicurl, options)
-
发送图文消息:
$client.send_news_custom(to_user, *articles)
相关推荐
如何合理的使用微信接口凭证access_token
access_token验证过期类,验证过期的处理办法,超过一小时则从新获取。
博客教程《微信公众平台开发教程第22篇-如何保证access_token长期有效》的配套代码,教程地址如下: http://blog.csdn.net/lyq8479/article/details/25076223
主要介绍了微信公众号获取access_token的方法,结合实例形式分析了java实现微信公众号获取access_token的相关原理、实现方法及操作注意事项,需要的朋友可以参考下
|文件名|功能简介| |:--------:|------| |conf/wx_config.json|设置微信 app_id 和 app_secret| |destinations/wx_flush_access_token.js|获取access_token| |shipper.js|将access_token写到文件, 或读取access_...
微信公众号接入微信平台并获取acess_token,并存入redis中
access_token分类一是普通access_token,二是网页授权access_token。这篇文章主要介绍了详解微信开发之access_token之坑,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
NULL 博文链接:https://hanbaohong.iteye.com/blog/2292193
本代码演示通过VS2017 C# 获取微信token及验证access_token是否过期,以及通过access_token读取云中存储的数据。
微信 公众号 access_token 接口 调用实例 java
代码是用asp独立完成编写的,已成功运用在微信活动项目中,编写过程中搜不到具体的案例...之前放出过一个版本,较之前的版本,这次新增了缓存access_token到数据库的功能,避免在获取用户信息时重复获取access_token
微信鞢大规模大起大落相去甚远东走西顾鞋柜霜期云蒸霞蔚土;;f]aerq[rq]r[q]r]qwr]qwer'栽植奇才独特tet
在微信文章二次转发过程中,标题和图片会丢失,获取微信签名并将签名返回值进行判断,返回给要调运的借口
微信文档里存在两种access_token:普通 access_token 和 网页授权 access_token。具体区别参考:https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421140842 以下提到的 access_token 均为普通的 access_...
当你的多个微信开发相关服务并存时,多个服务各自去获取 access_token ,最后导致其中一些服务会不能正常访问. 所以这种情况下,应该设置一个获取 access_token 的中控服务器. 因为 access_token 的有效期为 2个小时, ...
作为一款无需下载安装即可使用的应用,【小程序名称】依托于微信庞大的生态系统,让用户在微信内就能轻松实现各种功能操作。 【小程序名称】的核心功能主要集中在【具体服务领域】,例如在线购物、本地生活服务、...
本文实例讲述了PHP定时任务获取微信access_token的方法。分享给大家供大家参考,具体如下: 微信access_token在开发时会变的好像...由于微信对获取access_token的api调用次数做了限制,建议开发者全局存储与更新access_
微信企业号 开发平台token验证,修改为自己的token和随机数,企业号id即可。
由于获取access_token的api调用次数非常有限,建议开发者全局存储与更新access_token,频繁刷新access_token会导致api调用受限,影响自身业务。 二、要解决的问题 1、如何获取access_token。 2、由于access_token的...