Module: WxExt::Api::Mass
Overview
User api of weixin.
Instance Method Summary collapse
-
#del_mass(access_token, msg_id) ⇒ Hash
Del mass via post.
-
#get_mass_status(access_token, msg_id) ⇒ Hash
Get mass status via post.
-
#mass_by_filter_group(access_token, filter_hash) ⇒ Hash
Mass to users by filter group via post.
-
#mass_by_openid(access_token, openid_hash) ⇒ Hash
Mass to users by openid via post.
-
#preview_mass(access_token, preview_hash) ⇒ Hash
Preview mass via post.
-
#upload_news(access_token, news_hash) ⇒ Hash
Upload news to weixin server via post.
Instance Method Details
#del_mass(access_token, msg_id) ⇒ Hash
Del mass via post.
52 53 54 55 56 |
# File 'lib/wx_ext/api/mass.rb', line 52 def del_mass(access_token, msg_id) url = 'https://api.weixin.qq.com/cgi-bin/message/mass/delete'\ "?access_token=#{access_token}" Helper.http_post(url, { msg_id: msg_id }.to_json) end |
#get_mass_status(access_token, msg_id) ⇒ Hash
Get mass status via post.
74 75 76 77 78 |
# File 'lib/wx_ext/api/mass.rb', line 74 def get_mass_status(access_token, msg_id) url = 'https://api.weixin.qq.com/cgi-bin/message/mass/get'\ "?access_token=#{access_token}" Helper.http_post(url, { msg_id: msg_id }.to_json) end |
#mass_by_filter_group(access_token, filter_hash) ⇒ Hash
Mass to users by filter group via post.
30 31 32 33 34 |
# File 'lib/wx_ext/api/mass.rb', line 30 def mass_by_filter_group(access_token, filter_hash) url = 'https://api.weixin.qq.com/cgi-bin/message/mass/sendall'\ "?access_token=#{access_token}" Helper.http_post(url, filter_hash.to_json) end |
#mass_by_openid(access_token, openid_hash) ⇒ Hash
Mass to users by openid via post.
41 42 43 44 45 |
# File 'lib/wx_ext/api/mass.rb', line 41 def mass_by_openid(access_token, openid_hash) url = 'https://api.weixin.qq.com/cgi-bin/message/mass/send'\ "?access_token=#{access_token}" Helper.http_post(url, openid_hash.to_json) end |
#preview_mass(access_token, preview_hash) ⇒ Hash
Preview mass via post.
63 64 65 66 67 |
# File 'lib/wx_ext/api/mass.rb', line 63 def preview_mass(access_token, preview_hash) url = 'https://api.weixin.qq.com/cgi-bin/message/mass/preview'\ "?access_token=#{access_token}" Helper.http_post(url, preview_hash.to_json) end |
#upload_news(access_token, news_hash) ⇒ Hash
Upload news to weixin server via post.
19 20 21 22 23 |
# File 'lib/wx_ext/api/mass.rb', line 19 def upload_news(access_token, news_hash) url = 'https://api.weixin.qq.com/cgi-bin/media/uploadnews'\ "?access_token=#{access_token}" Helper.http_post(url, news_hash.to_json) end |