WeChat.Component (wechat v0.6.0)
第三方平台
Link to this section Summary
Link to this section Types
Link to this type
auth_type()
Specs
auth_type() :: 1 | 2 | 3
要授权的帐号类型:
- 则商户点击链接后,手机端仅展示公众号;
- 表示仅展示小程序;
- 表示公众号和小程序都展示。如果为未指定,则默认小程序和公众号都展示.
第三方平台开发者可以使用本字段来控制授权的帐号类型.
Link to this type
biz_appid()
Specs
biz_appid() :: WeChat.appid()
Link to this type
option_name()
Specs
option_name() :: String.t()
选项名称及可选值说明 - 官方文档
option_name | 选项名说明 | option_value | 选项值说明 |
---|---|---|---|
location_report | 地理位置上报选项 | 0 | 无上报 |
location_report | 地理位置上报选项 | 1 | 进入会话时上报 |
location_report | 地理位置上报选项 | 2 | 每 5s 上报 |
voice_recognize | 语音识别开关选项 | 0 | 关闭语音识别 |
voice_recognize | 语音识别开关选项 | 1 | 开启语音识别 |
customer_service | 多客服开关选项 | 0 | 关闭多客服 |
customer_service | 多客服开关选项 | 1 | 开启多客服 |
Link to this section Functions
Link to this function
authorizer_token(client)
Specs
authorizer_token(WeChat.client()) :: nil | WeChat.response()
获取/刷新接口调用令牌 - 官方文档
Link to this function
bind_component_url(client, redirect_uri, auth_type_or_biz_appid)
Specs
bind_component_url( WeChat.client(), redirect_uri :: String.t(), auth_type() | biz_appid() ) :: url :: String.t() | WeChat.response()
生成授权链接 - 官方文档
Link to this function
clear_quota(client)
Specs
clear_quota(WeChat.client()) :: WeChat.response()
接口调用次数清零 - 官方文档
Link to this function
create(client, appid)
Specs
create(WeChat.client(), WeChat.appid()) :: WeChat.response()
创建开放平台帐号并绑定公众号/小程序 - 官方文档
该 API 用于创建一个开放平台帐号,并将一个尚未绑定开放平台帐号的公众号/小程序绑定至该开放平台帐号上。
新创建的开放平台帐号的主体信息将设置为与之绑定的公众号或小程序的主体。
Link to this function
create(client, appid, open_appid)
Specs
create(WeChat.client(), WeChat.appid(), WeChat.appid()) :: WeChat.response()
将公众号/小程序绑定到开放平台帐号下 - 官方文档
该 API 用于将一个尚未绑定开放平台帐号的公众号或小程序绑定至指定开放平台帐号上。
二者须主体相同。
Link to this function
create_pre_auth_code(client)
Specs
create_pre_auth_code(WeChat.client()) :: WeChat.response()
获取预授权码 - 官方文档
Link to this function
get(client, appid)
Specs
get(WeChat.client(), WeChat.appid()) :: WeChat.response()
获取公众号/小程序所绑定的开放平台帐号 - 官方文档
该 API 用于获取公众号或小程序所绑定的开放平台帐号。
Link to this function
get_access_token(component_appid)
Link to this function
get_authorizer_info(client)
Specs
get_authorizer_info(WeChat.client()) :: WeChat.response()
获取授权方的帐号基本信息 - 官方文档
Link to this function
get_authorizer_list(client, offset, count)
Specs
get_authorizer_list(WeChat.client(), offset :: integer(), count :: integer()) :: WeChat.response()
拉取所有已授权的帐号信息 - 官方文档
Link to this function
get_authorizer_option(client, option_name)
Specs
get_authorizer_option(WeChat.client(), option_name()) :: WeChat.response()
获取授权方选项信息 - 官方文档
Link to this function
get_component_token(client)
Specs
get_component_token(WeChat.client()) :: nil | WeChat.response()
获取令牌 - 官方文档
Link to this function
query_auth(client, authorization_code)
Specs
query_auth(WeChat.client(), authorization_code :: String.t()) :: WeChat.response()
使用授权码获取授权信息 - 官方文档
Link to this function
unbind(client, appid, open_appid)
Specs
unbind(WeChat.client(), WeChat.appid(), WeChat.appid()) :: WeChat.response()
将公众号/小程序从开放平台帐号下解绑 - 官方文档
该 API 用于将一个公众号或小程序与指定开放平台帐号解绑。
开发者须确认所指定帐号与当前该公众号或小程序所绑定的开放平台帐号一致。