module WxExt::Api::CustomerService

User api of weixin.

@author FuShengYang

Public Instance Methods

reply_msg(access_token, to_user_openid, msg_type, msg_hash) click to toggle source

Reply msg via post.

@param [Enumerable<String>] access_token @param [Enumerable<String>] to_user_openid @param [Enumerable<String>] msg_type @param [Hash] msg_hash @return [Hash] Json based hash.

# File lib/wx_ext/api/customer_service.rb, line 21
def reply_msg(access_token, to_user_openid, msg_type, msg_hash)
  url = 'https://api.weixin.qq.com/cgi-bin/message/custom/send'\
        "?access_token=#{access_token}"
  msg_hash = {
    :touser => to_user_openid,
    :msgtype => msg_type,
    "#{msg_type}".to_sym => msg_hash
  }
  Helper.http_post(url, msg_hash.to_json)
end