Module: WeixinAuthorize::Api::User

Included in:
Client
Defined in:
lib/weixin_authorize/api/user.rb

Instance Method Summary collapse

Instance Method Details

#followers(next_openid = "") ⇒ Object



38
39
40
41
# File 'lib/weixin_authorize/api/user.rb', line 38

def followers(next_openid="")
  followers_url = "#{user_base_url}/get"
  http_get(followers_url, {next_openid: next_openid})
end

#update_remark(openid, remark) ⇒ Object

设置备注名 http请求方式: POST(请使用https协议) api.weixin.qq.com/cgi-bin/user/info/updateremark?access_token=ACCESS_TOKEN POST数据格式:JSON POST数据例子:

"openid":"oDF3iY9ffA-hqb2vVvbr7qxf6A0Q",
"remark":"pangzi"



52
53
54
55
56
57
58
59
# File 'lib/weixin_authorize/api/user.rb', line 52

def update_remark(openid, remark)
  update_url = "/user/info/updateremark"
  post_body = {
    openid: openid,
    remark: remark
  }
  http_post(update_url, post_body)
end

#user(openid, lang = "zh_CN") ⇒ Object



9
10
11
12
# File 'lib/weixin_authorize/api/user.rb', line 9

def user(openid, lang="zh_CN")
   = "#{user_base_url}/info"
  http_get(, {openid: openid, lang: lang})
end

#users(user_list) ⇒ Object

{

"user_list": [
  {
    "openid": "otvxTs4dckWG7imySrJd6jSi0CWE",
    "lang": "zh-CN"
  },
  {
    "openid": "otvxTs_JZ6SEiP0imdhpi50fuSZg",
    "lang": "zh-CN"
  }
]

}



30
31
32
33
34
# File 'lib/weixin_authorize/api/user.rb', line 30

def users(user_list)
   = "#{user_base_url}/info/batchget"
  post_body = user_list
  http_post(, post_body)
end