Class: Wechat::Core::Follower

Inherits:
Object
  • Object
show all
Defined in:
lib/wechat/core/follower.rb

Class Method Summary collapse

Class Method Details

.index(access_token, next_open_id = nil) ⇒ Object

获取关注者列表mp.weixin.qq.com/wiki/0/d0e07720fc711c02a3eab6ec33054804.html

Return hash format if success: {

total: <TOTAL>,
count: <COUNT>,
data: { openid: [ <OPEN_ID_1>, <OPEN_ID_2>, ... ] },
next_openid: <NEXT_OPEN_ID>

}



15
16
17
18
19
20
21
22
# File 'lib/wechat/core/follower.rb', line 15

def self.index(access_token, next_open_id = nil)

  options = { access_token: access_token }
  options[:next_openid] = next_open_id if next_open_id.present?

  message = ::JSONClient.new.get 'https://api.weixin.qq.com/cgi-bin/user/get', options
  message.body
end