Module: WechatGate::Media

Included in:
Config
Defined in:
lib/wechat_gate/media.rb

Instance Method Summary collapse

Instance Method Details

#medias(type = 'news', offset = 0, count = 20) ⇒ Object

type: image | video | voice | news (图文)



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/wechat_gate/media.rb', line 10

def medias(type = 'news', offset = 0, count = 20)
  WechatGate::Request.send(
    "https://api.weixin.qq.com/cgi-bin/material/batchget_material?access_token=#{self.access_token}",
    :post,
    {
      "type": type,
      "offset": offset,
      "count": count
    }.to_json
  )
end