Module: WechatClient::Apis::Getting

Included in:
WechatClient::Api
Defined in:
lib/wechat_client/apis/getting.rb

Instance Method Summary collapse

Instance Method Details

#__access_token__Object



15
16
17
18
# File 'lib/wechat_client/apis/getting.rb', line 15

def __access_token__
  # for debug
  "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=#{@options.app_id}&secret=#{@options.app_secret}"
end

#__jsapi_ticket__Object



68
69
70
# File 'lib/wechat_client/apis/getting.rb', line 68

def __jsapi_ticket__
  "https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=#{_access_token_}&type=jsapi"
end

#access_tokenObject



11
12
13
# File 'lib/wechat_client/apis/getting.rb', line 11

def access_token
  "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=#{@options.app_id}&secret=#{@options.app_secret}"
end

#auth_access_tokenObject

用户管理



30
31
32
# File 'lib/wechat_client/apis/getting.rb', line 30

def auth_access_token
  "https://api.weixin.qq.com/sns/oauth2/access_token?appid=#{@options.app_id}&secret=#{@options.app_secret}&grant_type=authorization_code&"
end

#auth_access_token_validationObject



42
43
44
# File 'lib/wechat_client/apis/getting.rb', line 42

def auth_access_token_validation
  "https://api.weixin.qq.com/sns/auth?"
end

#auth_infoObject



38
39
40
# File 'lib/wechat_client/apis/getting.rb', line 38

def auth_info
  "https://api.weixin.qq.com/sns/userinfo?lang=zh_CN&"
end

#base_infoObject



34
35
36
# File 'lib/wechat_client/apis/getting.rb', line 34

def base_info
  "https://api.weixin.qq.com/cgi-bin/user/info?access_token=#{_access_token_}&lang=zh_CN&"
end

#delete_menusObject



56
57
58
# File 'lib/wechat_client/apis/getting.rb', line 56

def delete_menus
  "https://api.weixin.qq.com/cgi-bin/menu/delete?access_token=#{_access_token_}"
end

#jsapi_ticketObject

jsapi



64
65
66
# File 'lib/wechat_client/apis/getting.rb', line 64

def jsapi_ticket
  "https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=#{_access_token_}&type=jsapi"
end

菜单管理



52
53
54
# File 'lib/wechat_client/apis/getting.rb', line 52

def menus
  "https://api.weixin.qq.com/cgi-bin/menu/get?access_token=#{_access_token_}"
end

#refresh_auth_access_tokenObject



46
47
48
# File 'lib/wechat_client/apis/getting.rb', line 46

def refresh_auth_access_token
  "https://api.weixin.qq.com/sns/oauth2/refresh_token?appid=#{@options.app_id}&grant_type=refresh_token&"
end

#send_messageObject

发送消息



22
23
24
# File 'lib/wechat_client/apis/getting.rb', line 22

def send_message
  "https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=#{_access_token_}"
end

#server_ipObject

获取接口调用凭据



7
8
9
# File 'lib/wechat_client/apis/getting.rb', line 7

def server_ip
  "https://api.weixin.qq.com/cgi-bin/getcallbackip?access_token=#{_access_token_}"
end