elixir_wechat v0.1.2 DynamicAppIdHubClient
NOTICE: THIS MODULE IS ONLY FOR DOCUMENT.
Initialize a WeChat client without appid
, each time when invoke WeChat services need to input the appid
as a parameter.
This suite is used for construct a Client to invoke WeChat APIs for serve multiple WeChat official accounts dynamically via elixir_wechat
library, this usecase is usual for the Server(:hub
scenario) side.
defmodule WeChat.MyApp do
use WeChat,
scenario: :hub,
adapter_storage: MockHub.Adapter.Common
end
MockHub.Adapter.Common
is ONLY a sample module implemented WeChat.Adapter.Storage.Hub
.
Options:
:appid
- the appid of WeChat official account.:scenario
- the scenario of initialized client, options::hub
or:client
, set as:hub
option means it is self-manange access token in the hub, we need to do it when using this library in the Server side, set as:client
option means this library sends refresh request to the hub to fetch valid access token, using:client
by default.:adapter_storage
- the implements for some items persistence, e.g.access_token
,secret_key
and etc, when set scenario as:hub
, this field option is required, please implement required functions followWeChat.Adapter.Storage.Hub
behaviour module.
Link to this section Summary
Functions
Perform CARD API(s)
Perform CARD API(s)
Perform CARD API(s)
Perform CARD_CODE API(s)
Perform CARD_CODE API(s)
Perform CARD_CODE API(s)
Perform CARD_USER API(s)
Perform CARD_USER API(s)
Perform CARD_USER API(s)
Perform DATACUBE API(s)
Perform DATACUBE API(s)
Perform DATACUBE API(s)
Perform MATERIAL API(s)
Perform MATERIAL API(s)
Perform MATERIAL API(s)
Perform MEDIA API(s)
Perform MEDIA API(s)
Perform MEDIA API(s)
Perform MENU API(s)
Perform MENU API(s)
Perform MENU API(s)
Perform MESSAGE_CUSTOM API(s)
Perform MESSAGE_CUSTOM API(s)
Perform MESSAGE_CUSTOM API(s)
Perform MESSAGE_TEMPLATE API(s)
Perform MESSAGE_TEMPLATE API(s)
Perform MESSAGE_TEMPLATE API(s)
Perform POI API(s)
Perform POI API(s)
Perform POI API(s)
Perform QRCODE API(s)
Perform QRCODE API(s)
Perform QRCODE API(s)
Refresh access_token of common application in :hub
scenario
Perform SHORTURL API(s)
Perform SHORTURL API(s)
Perform SHOWQRCODE API(s)
Perform SHOWQRCODE API(s)
Perform SHOWQRCODE API(s)
Perform TAGS API(s)
Perform TAGS API(s)
Perform TAGS API(s)
Perform TEMPLATE API(s)
Perform TEMPLATE API(s)
Perform TEMPLATE API(s)
Perform TOKEN API(s)
Perform TOKEN API(s)
Perform TOKEN API(s)
Perform USER API(s)
Perform USER API(s)
Perform USER API(s)
Link to this section Functions
card(http_verb, appid)
Perform CARD API(s).
card(:get, appid)
card(:post, appid)
Send request to URL https://api.weixin.qq.com/card
.
card(http_verb, appid, required)
Perform CARD API(s)
card(:get, appid, uri_supplement)
card(:get, appid, query)
card(:post, appid, uri_supplement)
card(:post, appid, data)
Send request to URL https://api.weixin.qq.com/card
.
Refer WeChat Official Accounts Platform document, if you need to call a service's url is https://api.weixin.qq.com/card/${uri_supplement}
, please use uri_supplement
parameter to construct the corresponding service's complete url, for example:
card(:http_verb, appid, :"${uri_supplement}")
card(http_verb, appid, uri_supplement, parameters)
Perform CARD API(s)
card(:get, appid, uri_supplement, query)
card(:post, appid, uri_supplement, data)
Send request to URL https://api.weixin.qq.com/card
.
Refer WeChat Official Accounts Platform document, if you need to call a service's url is https://api.weixin.qq.com/card/${uri_supplement}
, and need to post data or append query string, please use uri_supplement
parameter to construct the corresponding service's complete url, for example:
card(:http_verb, appid, :"${uri_supplement}", query)
card(:http_verb, appid, :"${uri_supplement}", data)
card_code(http_verb, appid)
Perform CARD_CODE API(s).
card_code(:get, appid)
card_code(:post, appid)
Send request to URL https://api.weixin.qq.com/card/code
.
card_code(http_verb, appid, required)
Perform CARD_CODE API(s)
card_code(:get, appid, uri_supplement)
card_code(:get, appid, query)
card_code(:post, appid, uri_supplement)
card_code(:post, appid, data)
Send request to URL https://api.weixin.qq.com/card/code
.
Refer WeChat Official Accounts Platform document, if you need to call a service's url is https://api.weixin.qq.com/card/code/${uri_supplement}
, please use uri_supplement
parameter to construct the corresponding service's complete url, for example:
card_code(:http_verb, appid, :"${uri_supplement}")
card_code(http_verb, appid, uri_supplement, parameters)
Perform CARD_CODE API(s)
card_code(:get, appid, uri_supplement, query)
card_code(:post, appid, uri_supplement, data)
Send request to URL https://api.weixin.qq.com/card/code
.
Refer WeChat Official Accounts Platform document, if you need to call a service's url is https://api.weixin.qq.com/card/code/${uri_supplement}
, and need to post data or append query string, please use uri_supplement
parameter to construct the corresponding service's complete url, for example:
card_code(:http_verb, appid, :"${uri_supplement}", query)
card_code(:http_verb, appid, :"${uri_supplement}", data)
card_user(http_verb, appid)
Perform CARD_USER API(s).
card_user(:get, appid)
card_user(:post, appid)
Send request to URL https://api.weixin.qq.com/card/user
.
card_user(http_verb, appid, required)
Perform CARD_USER API(s)
card_user(:get, appid, uri_supplement)
card_user(:get, appid, query)
card_user(:post, appid, uri_supplement)
card_user(:post, appid, data)
Send request to URL https://api.weixin.qq.com/card/user
.
Refer WeChat Official Accounts Platform document, if you need to call a service's url is https://api.weixin.qq.com/card/user/${uri_supplement}
, please use uri_supplement
parameter to construct the corresponding service's complete url, for example:
card_user(:http_verb, appid, :"${uri_supplement}")
card_user(http_verb, appid, uri_supplement, parameters)
Perform CARD_USER API(s)
card_user(:get, appid, uri_supplement, query)
card_user(:post, appid, uri_supplement, data)
Send request to URL https://api.weixin.qq.com/card/user
.
Refer WeChat Official Accounts Platform document, if you need to call a service's url is https://api.weixin.qq.com/card/user/${uri_supplement}
, and need to post data or append query string, please use uri_supplement
parameter to construct the corresponding service's complete url, for example:
card_user(:http_verb, appid, :"${uri_supplement}", query)
card_user(:http_verb, appid, :"${uri_supplement}", data)
datacube(http_verb, appid)
Perform DATACUBE API(s).
datacube(:get, appid)
datacube(:post, appid)
Send request to URL https://api.weixin.qq.com/datacube
.
datacube(http_verb, appid, required)
Perform DATACUBE API(s)
datacube(:get, appid, uri_supplement)
datacube(:get, appid, query)
datacube(:post, appid, uri_supplement)
datacube(:post, appid, data)
Send request to URL https://api.weixin.qq.com/datacube
.
Refer WeChat Official Accounts Platform document, if you need to call a service's url is https://api.weixin.qq.com/datacube/${uri_supplement}
, please use uri_supplement
parameter to construct the corresponding service's complete url, for example:
datacube(:http_verb, appid, :"${uri_supplement}")
datacube(http_verb, appid, uri_supplement, parameters)
Perform DATACUBE API(s)
datacube(:get, appid, uri_supplement, query)
datacube(:post, appid, uri_supplement, data)
Send request to URL https://api.weixin.qq.com/datacube
.
Refer WeChat Official Accounts Platform document, if you need to call a service's url is https://api.weixin.qq.com/datacube/${uri_supplement}
, and need to post data or append query string, please use uri_supplement
parameter to construct the corresponding service's complete url, for example:
datacube(:http_verb, appid, :"${uri_supplement}", query)
datacube(:http_verb, appid, :"${uri_supplement}", data)
get_access_token(appid)
material(http_verb, appid)
Perform MATERIAL API(s).
material(:get, appid)
material(:post, appid)
Send request to URL https://api.weixin.qq.com/cgi-bin/material
.
material(http_verb, appid, required)
Perform MATERIAL API(s)
material(:get, appid, uri_supplement)
material(:get, appid, query)
material(:post, appid, uri_supplement)
material(:post, appid, data)
Send request to URL https://api.weixin.qq.com/cgi-bin/material
.
Refer WeChat Official Accounts Platform document, if you need to call a service's url is https://api.weixin.qq.com/cgi-bin/material/${uri_supplement}
, please use uri_supplement
parameter to construct the corresponding service's complete url, for example:
material(:http_verb, appid, :"${uri_supplement}")
material(http_verb, appid, uri_supplement, parameters)
Perform MATERIAL API(s)
material(:get, appid, uri_supplement, query)
material(:post, appid, uri_supplement, data)
Send request to URL https://api.weixin.qq.com/cgi-bin/material
.
Refer WeChat Official Accounts Platform document, if you need to call a service's url is https://api.weixin.qq.com/cgi-bin/material/${uri_supplement}
, and need to post data or append query string, please use uri_supplement
parameter to construct the corresponding service's complete url, for example:
material(:http_verb, appid, :"${uri_supplement}", query)
material(:http_verb, appid, :"${uri_supplement}", data)
media(http_verb, appid)
Perform MEDIA API(s).
media(:get, appid)
media(:post, appid)
Send request to URL https://api.weixin.qq.com/cgi-bin/media
.
media(http_verb, appid, required)
Perform MEDIA API(s)
media(:get, appid, uri_supplement)
media(:get, appid, query)
media(:post, appid, uri_supplement)
media(:post, appid, data)
Send request to URL https://api.weixin.qq.com/cgi-bin/media
.
Refer WeChat Official Accounts Platform document, if you need to call a service's url is https://api.weixin.qq.com/cgi-bin/media/${uri_supplement}
, please use uri_supplement
parameter to construct the corresponding service's complete url, for example:
media(:http_verb, appid, :"${uri_supplement}")
media(http_verb, appid, uri_supplement, parameters)
Perform MEDIA API(s)
media(:get, appid, uri_supplement, query)
media(:post, appid, uri_supplement, data)
Send request to URL https://api.weixin.qq.com/cgi-bin/media
.
Refer WeChat Official Accounts Platform document, if you need to call a service's url is https://api.weixin.qq.com/cgi-bin/media/${uri_supplement}
, and need to post data or append query string, please use uri_supplement
parameter to construct the corresponding service's complete url, for example:
media(:http_verb, appid, :"${uri_supplement}", query)
media(:http_verb, appid, :"${uri_supplement}", data)
message_custom(http_verb, appid)
Perform MESSAGE_CUSTOM API(s).
message_custom(:get, appid)
message_custom(:post, appid)
Send request to URL https://api.weixin.qq.com/cgi-bin/message/custom
.
message_custom(http_verb, appid, required)
Perform MESSAGE_CUSTOM API(s)
message_custom(:get, appid, uri_supplement)
message_custom(:get, appid, query)
message_custom(:post, appid, uri_supplement)
message_custom(:post, appid, data)
Send request to URL https://api.weixin.qq.com/cgi-bin/message/custom
.
Refer WeChat Official Accounts Platform document, if you need to call a service's url is https://api.weixin.qq.com/cgi-bin/message/custom/${uri_supplement}
, please use uri_supplement
parameter to construct the corresponding service's complete url, for example:
message_custom(:http_verb, appid, :"${uri_supplement}")
message_custom(http_verb, appid, uri_supplement, parameters)
Perform MESSAGE_CUSTOM API(s)
message_custom(:get, appid, uri_supplement, query)
message_custom(:post, appid, uri_supplement, data)
Send request to URL https://api.weixin.qq.com/cgi-bin/message/custom
.
Refer WeChat Official Accounts Platform document, if you need to call a service's url is https://api.weixin.qq.com/cgi-bin/message/custom/${uri_supplement}
, and need to post data or append query string, please use uri_supplement
parameter to construct the corresponding service's complete url, for example:
message_custom(:http_verb, appid, :"${uri_supplement}", query)
message_custom(:http_verb, appid, :"${uri_supplement}", data)
message_template(http_verb, appid)
Perform MESSAGE_TEMPLATE API(s).
message_template(:get, appid)
message_template(:post, appid)
Send request to URL https://api.weixin.qq.com/cgi-bin/message/template
.
message_template(http_verb, appid, required)
Perform MESSAGE_TEMPLATE API(s)
message_template(:get, appid, uri_supplement)
message_template(:get, appid, query)
message_template(:post, appid, uri_supplement)
message_template(:post, appid, data)
Send request to URL https://api.weixin.qq.com/cgi-bin/message/template
.
Refer WeChat Official Accounts Platform document, if you need to call a service's url is https://api.weixin.qq.com/cgi-bin/message/template/${uri_supplement}
, please use uri_supplement
parameter to construct the corresponding service's complete url, for example:
message_template(:http_verb, appid, :"${uri_supplement}")
message_template(http_verb, appid, uri_supplement, parameters)
Perform MESSAGE_TEMPLATE API(s)
message_template(:get, appid, uri_supplement, query)
message_template(:post, appid, uri_supplement, data)
Send request to URL https://api.weixin.qq.com/cgi-bin/message/template
.
Refer WeChat Official Accounts Platform document, if you need to call a service's url is https://api.weixin.qq.com/cgi-bin/message/template/${uri_supplement}
, and need to post data or append query string, please use uri_supplement
parameter to construct the corresponding service's complete url, for example:
message_template(:http_verb, appid, :"${uri_supplement}", query)
message_template(:http_verb, appid, :"${uri_supplement}", data)
poi(http_verb, appid)
Perform POI API(s).
poi(:get, appid)
poi(:post, appid)
Send request to URL https://api.weixin.qq.com/cgi-bin/poi
.
poi(http_verb, appid, required)
Perform POI API(s)
poi(:get, appid, uri_supplement)
poi(:get, appid, query)
poi(:post, appid, uri_supplement)
poi(:post, appid, data)
Send request to URL https://api.weixin.qq.com/cgi-bin/poi
.
Refer WeChat Official Accounts Platform document, if you need to call a service's url is https://api.weixin.qq.com/cgi-bin/poi/${uri_supplement}
, please use uri_supplement
parameter to construct the corresponding service's complete url, for example:
poi(:http_verb, appid, :"${uri_supplement}")
poi(http_verb, appid, uri_supplement, parameters)
Perform POI API(s)
poi(:get, appid, uri_supplement, query)
poi(:post, appid, uri_supplement, data)
Send request to URL https://api.weixin.qq.com/cgi-bin/poi
.
Refer WeChat Official Accounts Platform document, if you need to call a service's url is https://api.weixin.qq.com/cgi-bin/poi/${uri_supplement}
, and need to post data or append query string, please use uri_supplement
parameter to construct the corresponding service's complete url, for example:
poi(:http_verb, appid, :"${uri_supplement}", query)
poi(:http_verb, appid, :"${uri_supplement}", data)
qrcode(http_verb, appid)
Perform QRCODE API(s).
qrcode(:get, appid)
qrcode(:post, appid)
Send request to URL https://api.weixin.qq.com/cgi-bin/qrcode
.
qrcode(http_verb, appid, required)
Perform QRCODE API(s)
qrcode(:get, appid, uri_supplement)
qrcode(:get, appid, query)
qrcode(:post, appid, uri_supplement)
qrcode(:post, appid, data)
Send request to URL https://api.weixin.qq.com/cgi-bin/qrcode
.
Refer WeChat Official Accounts Platform document, if you need to call a service's url is https://api.weixin.qq.com/cgi-bin/qrcode/${uri_supplement}
, please use uri_supplement
parameter to construct the corresponding service's complete url, for example:
qrcode(:http_verb, appid, :"${uri_supplement}")
qrcode(http_verb, appid, uri_supplement, parameters)
Perform QRCODE API(s)
qrcode(:get, appid, uri_supplement, query)
qrcode(:post, appid, uri_supplement, data)
Send request to URL https://api.weixin.qq.com/cgi-bin/qrcode
.
Refer WeChat Official Accounts Platform document, if you need to call a service's url is https://api.weixin.qq.com/cgi-bin/qrcode/${uri_supplement}
, and need to post data or append query string, please use uri_supplement
parameter to construct the corresponding service's complete url, for example:
qrcode(:http_verb, appid, :"${uri_supplement}", query)
qrcode(:http_verb, appid, :"${uri_supplement}", data)
refresh_access_token(appid, options)
Refresh access_token of common application in :hub
scenario.
refresh_access_token(appid, [access_token: access_token])
set_access_token(appid, response_body, options)
shorturl(http_verb, appid, required)
Perform SHORTURL API(s)
shorturl(:post, appid, uri_supplement)
shorturl(:post, appid, data)
Send request to URL https://api.weixin.qq.com/cgi-bin/shorturl
.
Refer WeChat Official Accounts Platform document, if you need to call a service's url is https://api.weixin.qq.com/cgi-bin/shorturl/${uri_supplement}
, please use uri_supplement
parameter to construct the corresponding service's complete url, for example:
shorturl(:http_verb, appid, :"${uri_supplement}")
shorturl(http_verb, appid, uri_supplement, parameters)
Perform SHORTURL API(s)
shorturl(:post, appid, uri_supplement, data)
Send request to URL https://api.weixin.qq.com/cgi-bin/shorturl
.
Refer WeChat Official Accounts Platform document, if you need to call a service's url is https://api.weixin.qq.com/cgi-bin/shorturl/${uri_supplement}
, and need to post data or append query string, please use uri_supplement
parameter to construct the corresponding service's complete url, for example:
shorturl(:http_verb, appid, :"${uri_supplement}", query)
shorturl(:http_verb, appid, :"${uri_supplement}", data)
showqrcode(http_verb, appid)
Perform SHOWQRCODE API(s).
showqrcode(:get, appid)
Send request to URL https://mp.weixin.qq.com/cgi-bin/showqrcode
.
showqrcode(http_verb, appid, required)
Perform SHOWQRCODE API(s)
showqrcode(:get, appid, uri_supplement)
showqrcode(:get, appid, query)
Send request to URL https://mp.weixin.qq.com/cgi-bin/showqrcode
.
Refer WeChat Official Accounts Platform document, if you need to call a service's url is https://mp.weixin.qq.com/cgi-bin/showqrcode/${uri_supplement}
, please use uri_supplement
parameter to construct the corresponding service's complete url, for example:
showqrcode(:http_verb, appid, :"${uri_supplement}")
showqrcode(http_verb, appid, uri_supplement, parameters)
Perform SHOWQRCODE API(s)
showqrcode(:get, appid, uri_supplement, query)
Send request to URL https://mp.weixin.qq.com/cgi-bin/showqrcode
.
Refer WeChat Official Accounts Platform document, if you need to call a service's url is https://mp.weixin.qq.com/cgi-bin/showqrcode/${uri_supplement}
, and need to post data or append query string, please use uri_supplement
parameter to construct the corresponding service's complete url, for example:
showqrcode(:http_verb, appid, :"${uri_supplement}", query)
showqrcode(:http_verb, appid, :"${uri_supplement}", data)
tags(http_verb, appid)
Perform TAGS API(s).
tags(:get, appid)
tags(:post, appid)
Send request to URL https://api.weixin.qq.com/cgi-bin/tags
.
tags(http_verb, appid, required)
Perform TAGS API(s)
tags(:get, appid, uri_supplement)
tags(:get, appid, query)
tags(:post, appid, uri_supplement)
tags(:post, appid, data)
Send request to URL https://api.weixin.qq.com/cgi-bin/tags
.
Refer WeChat Official Accounts Platform document, if you need to call a service's url is https://api.weixin.qq.com/cgi-bin/tags/${uri_supplement}
, please use uri_supplement
parameter to construct the corresponding service's complete url, for example:
tags(:http_verb, appid, :"${uri_supplement}")
tags(http_verb, appid, uri_supplement, parameters)
Perform TAGS API(s)
tags(:get, appid, uri_supplement, query)
tags(:post, appid, uri_supplement, data)
Send request to URL https://api.weixin.qq.com/cgi-bin/tags
.
Refer WeChat Official Accounts Platform document, if you need to call a service's url is https://api.weixin.qq.com/cgi-bin/tags/${uri_supplement}
, and need to post data or append query string, please use uri_supplement
parameter to construct the corresponding service's complete url, for example:
tags(:http_verb, appid, :"${uri_supplement}", query)
tags(:http_verb, appid, :"${uri_supplement}", data)
template(http_verb, appid)
Perform TEMPLATE API(s).
template(:get, appid)
template(:post, appid)
Send request to URL https://api.weixin.qq.com/cgi-bin/template
.
template(http_verb, appid, required)
Perform TEMPLATE API(s)
template(:get, appid, uri_supplement)
template(:get, appid, query)
template(:post, appid, uri_supplement)
template(:post, appid, data)
Send request to URL https://api.weixin.qq.com/cgi-bin/template
.
Refer WeChat Official Accounts Platform document, if you need to call a service's url is https://api.weixin.qq.com/cgi-bin/template/${uri_supplement}
, please use uri_supplement
parameter to construct the corresponding service's complete url, for example:
template(:http_verb, appid, :"${uri_supplement}")
template(http_verb, appid, uri_supplement, parameters)
Perform TEMPLATE API(s)
template(:get, appid, uri_supplement, query)
template(:post, appid, uri_supplement, data)
Send request to URL https://api.weixin.qq.com/cgi-bin/template
.
Refer WeChat Official Accounts Platform document, if you need to call a service's url is https://api.weixin.qq.com/cgi-bin/template/${uri_supplement}
, and need to post data or append query string, please use uri_supplement
parameter to construct the corresponding service's complete url, for example:
template(:http_verb, appid, :"${uri_supplement}", query)
template(:http_verb, appid, :"${uri_supplement}", data)
token(http_verb, appid)
Perform TOKEN API(s).
token(:get, appid)
Send request to URL https://api.weixin.qq.com/cgi-bin/token
.
token(http_verb, appid, required)
Perform TOKEN API(s)
token(:get, appid, uri_supplement)
token(:get, appid, query)
Send request to URL https://api.weixin.qq.com/cgi-bin/token
.
Refer WeChat Official Accounts Platform document, if you need to call a service's url is https://api.weixin.qq.com/cgi-bin/token/${uri_supplement}
, please use uri_supplement
parameter to construct the corresponding service's complete url, for example:
token(:http_verb, appid, :"${uri_supplement}")
token(http_verb, appid, uri_supplement, parameters)
Perform TOKEN API(s)
token(:get, appid, uri_supplement, query)
Send request to URL https://api.weixin.qq.com/cgi-bin/token
.
Refer WeChat Official Accounts Platform document, if you need to call a service's url is https://api.weixin.qq.com/cgi-bin/token/${uri_supplement}
, and need to post data or append query string, please use uri_supplement
parameter to construct the corresponding service's complete url, for example:
token(:http_verb, appid, :"${uri_supplement}", query)
token(:http_verb, appid, :"${uri_supplement}", data)
user(http_verb, appid)
Perform USER API(s).
user(:get, appid)
user(:post, appid)
Send request to URL https://api.weixin.qq.com/cgi-bin/user
.
user(http_verb, appid, required)
Perform USER API(s)
user(:get, appid, uri_supplement)
user(:get, appid, query)
user(:post, appid, uri_supplement)
user(:post, appid, data)
Send request to URL https://api.weixin.qq.com/cgi-bin/user
.
Refer WeChat Official Accounts Platform document, if you need to call a service's url is https://api.weixin.qq.com/cgi-bin/user/${uri_supplement}
, please use uri_supplement
parameter to construct the corresponding service's complete url, for example:
user(:http_verb, appid, :"${uri_supplement}")
user(http_verb, appid, uri_supplement, parameters)
Perform USER API(s)
user(:get, appid, uri_supplement, query)
user(:post, appid, uri_supplement, data)
Send request to URL https://api.weixin.qq.com/cgi-bin/user
.
Refer WeChat Official Accounts Platform document, if you need to call a service's url is https://api.weixin.qq.com/cgi-bin/user/${uri_supplement}
, and need to post data or append query string, please use uri_supplement
parameter to construct the corresponding service's complete url, for example:
user(:http_verb, appid, :"${uri_supplement}", query)
user(:http_verb, appid, :"${uri_supplement}", data)