C# Class Senparc.Weixin.Open.ComponentAPIs.ComponentApi

ComponentApi
Exibir arquivo Open project: JeffreySu/WeiXinMPSDK Class Usage Examples

Public Methods

Method Description
ApiAuthorizerToken ( string componentAccessToken, string componentAppId, string authorizerAppId, string authorizerRefreshToken = null, int timeOut = Config.TIME_OUT ) : RefreshAuthorizerTokenResult

获取(刷新)授权公众号的令牌 由于access_token拥有较短的有效期,当access_token超时后,可以使用refresh_token进行刷新,refresh_token拥有较长的有效期(30天),当refresh_token失效的后,需要用户重新授权。

ApiAuthorizerTokenAsync ( string componentAccessToken, string componentAppId, string authorizerAppId, string authorizerRefreshToken = null, int timeOut = Config.TIME_OUT ) : Task

【异步方法】获取(刷新)授权公众号的令牌 由于access_token拥有较短的有效期,当access_token超时后,可以使用refresh_token进行刷新,refresh_token拥有较长的有效期(30天),当refresh_token失效的后,需要用户重新授权。

ApiConfirmAuth ( string componentAccessToken, string componentAppId, string authorizerAppid, int funscopeCategoryId, int confirmValue, int timeOut = Config.TIME_OUT ) : WxJsonResult

确认授权

ApiConfirmAuthAsync ( string componentAccessToken, string componentAppId, string authorizerAppid, int funscopeCategoryId, int confirmValue, int timeOut = Config.TIME_OUT ) : Task

【异步方法】确认授权

GetAuthorizerInfo ( string componentAccessToken, string componentAppId, string authorizerAppId, int timeOut = Config.TIME_OUT ) : GetAuthorizerInfoResult

获取授权方信息 注意:此方法返回的JSON中,authorization_info.authorizer_appid等几个参数通常为空(哪怕公众号有权限)

GetAuthorizerInfoAsync ( string componentAccessToken, string componentAppId, string authorizerAppId, int timeOut = Config.TIME_OUT ) : Task

【异步方法】获取授权方信息 注意:此方法返回的JSON中,authorization_info.authorizer_appid等几个参数通常为空(哪怕公众号有权限)

GetAuthorizerOption ( string componentAccessToken, string componentAppId, string authorizerAppId, OptionName optionName, int timeOut = Config.TIME_OUT ) : AuthorizerOptionResult

获取授权方的选项设置信息

GetAuthorizerOptionAsync ( string componentAccessToken, string componentAppId, string authorizerAppId, OptionName optionName, int timeOut = Config.TIME_OUT ) : Task

【异步方法】获取授权方的选项设置信息

GetComponentAccessToken ( string componentAppId, string componentAppSecret, string componentVerifyTicket, int timeOut = Config.TIME_OUT ) : ComponentAccessTokenResult

获取第三方平台access_token

GetComponentAccessTokenAsync ( string componentAppId, string componentAppSecret, string componentVerifyTicket, int timeOut = Config.TIME_OUT ) : Task

【异步方法】获取第三方平台access_token

GetComponentLoginPageUrl ( string componentAppId, string preAuthCode, string redirectUrl ) : string

获取授权地址

GetJsApiTicket ( string authorizerAccessToken, string type = "jsapi" ) : JsApiTicketResult

文档:https://open.weixin.qq.com/cgi-bin/showdocument?action=dir_list&t=resource/res_list&verify=1&id=open1421823488&token=&lang=zh_CN 获取调用微信JS接口的临时票据 OPEN

GetJsApiTicketAsync ( string authorizerAccessToken, string type = "jsapi" ) : Task

文档:https://open.weixin.qq.com/cgi-bin/showdocument?action=dir_list&t=resource/res_list&verify=1&id=open1421823488&token=&lang=zh_CN 【异步方法】获取调用微信JS接口的临时票据 OPEN

GetPreAuthCode ( string componentAppId, string componentAccessToken, int timeOut = Config.TIME_OUT ) : PreAuthCodeResult

获取预授权码

GetPreAuthCodeAsync ( string componentAppId, string componentAccessToken, int timeOut = Config.TIME_OUT ) : Task

【异步方法】获取预授权码

QueryAuth ( string componentAccessToken, string componentAppId, string authorizationCode, int timeOut = Config.TIME_OUT ) : QueryAuthResult

使用授权码换取公众号的授权信息

QueryAuthAsync ( string componentAccessToken, string componentAppId, string authorizationCode, int timeOut = Config.TIME_OUT ) : Task

【异步方法】使用授权码换取公众号的授权信息

SetAuthorizerOption ( string componentAccessToken, string componentAppId, string authorizerAppId, OptionName optionName, int optionValue, int timeOut = Config.TIME_OUT ) : WxJsonResult

设置授权方的选项信息

SetAuthorizerOptionAsync ( string componentAccessToken, string componentAppId, string authorizerAppId, OptionName optionName, int optionValue, int timeOut = Config.TIME_OUT ) : Task

【异步方法】设置授权方的选项信息

Method Details

ApiAuthorizerToken() public static method

获取(刷新)授权公众号的令牌 由于access_token拥有较短的有效期,当access_token超时后,可以使用refresh_token进行刷新,refresh_token拥有较长的有效期(30天),当refresh_token失效的后,需要用户重新授权。
public static ApiAuthorizerToken ( string componentAccessToken, string componentAppId, string authorizerAppId, string authorizerRefreshToken = null, int timeOut = Config.TIME_OUT ) : RefreshAuthorizerTokenResult
componentAccessToken string
componentAppId string
authorizerAppId string
authorizerRefreshToken string
timeOut int
return RefreshAuthorizerTokenResult

ApiAuthorizerTokenAsync() public static method

【异步方法】获取(刷新)授权公众号的令牌 由于access_token拥有较短的有效期,当access_token超时后,可以使用refresh_token进行刷新,refresh_token拥有较长的有效期(30天),当refresh_token失效的后,需要用户重新授权。
public static ApiAuthorizerTokenAsync ( string componentAccessToken, string componentAppId, string authorizerAppId, string authorizerRefreshToken = null, int timeOut = Config.TIME_OUT ) : Task
componentAccessToken string
componentAppId string
authorizerAppId string
authorizerRefreshToken string
timeOut int
return Task

ApiConfirmAuth() public static method

确认授权
public static ApiConfirmAuth ( string componentAccessToken, string componentAppId, string authorizerAppid, int funscopeCategoryId, int confirmValue, int timeOut = Config.TIME_OUT ) : WxJsonResult
componentAccessToken string 服务开发方的access_token
componentAppId string 服务开发方的appid
authorizerAppid string 授权code,会在授权成功时返回给第三方平台,详见第三方平台授权流程说明
funscopeCategoryId int 服务开发方的access_token
confirmValue int 服务开发方的access_token
timeOut int 代理请求超时时间(毫秒)
return Senparc.Weixin.Entities.WxJsonResult

ApiConfirmAuthAsync() public static method

【异步方法】确认授权
public static ApiConfirmAuthAsync ( string componentAccessToken, string componentAppId, string authorizerAppid, int funscopeCategoryId, int confirmValue, int timeOut = Config.TIME_OUT ) : Task
componentAccessToken string 服务开发方的access_token
componentAppId string 服务开发方的appid
authorizerAppid string 授权code,会在授权成功时返回给第三方平台,详见第三方平台授权流程说明
funscopeCategoryId int 服务开发方的access_token
confirmValue int 服务开发方的access_token
timeOut int 代理请求超时时间(毫秒)
return Task

GetAuthorizerInfo() public static method

获取授权方信息 注意:此方法返回的JSON中,authorization_info.authorizer_appid等几个参数通常为空(哪怕公众号有权限)
public static GetAuthorizerInfo ( string componentAccessToken, string componentAppId, string authorizerAppId, int timeOut = Config.TIME_OUT ) : GetAuthorizerInfoResult
componentAccessToken string
componentAppId string
authorizerAppId string
timeOut int
return GetAuthorizerInfoResult

GetAuthorizerInfoAsync() public static method

【异步方法】获取授权方信息 注意:此方法返回的JSON中,authorization_info.authorizer_appid等几个参数通常为空(哪怕公众号有权限)
public static GetAuthorizerInfoAsync ( string componentAccessToken, string componentAppId, string authorizerAppId, int timeOut = Config.TIME_OUT ) : Task
componentAccessToken string
componentAppId string
authorizerAppId string
timeOut int
return Task

GetAuthorizerOption() public static method

获取授权方的选项设置信息
public static GetAuthorizerOption ( string componentAccessToken, string componentAppId, string authorizerAppId, OptionName optionName, int timeOut = Config.TIME_OUT ) : AuthorizerOptionResult
componentAccessToken string 服务开发方的access_token
componentAppId string 服务开发商的appid
authorizerAppId string 授权公众号appid
optionName OptionName 选项名称
timeOut int 代理请求超时时间(毫秒)
return AuthorizerOptionResult

GetAuthorizerOptionAsync() public static method

【异步方法】获取授权方的选项设置信息
public static GetAuthorizerOptionAsync ( string componentAccessToken, string componentAppId, string authorizerAppId, OptionName optionName, int timeOut = Config.TIME_OUT ) : Task
componentAccessToken string 服务开发方的access_token
componentAppId string 服务开发商的appid
authorizerAppId string 授权公众号appid
optionName OptionName 选项名称
timeOut int 代理请求超时时间(毫秒)
return Task

GetComponentAccessToken() public static method

获取第三方平台access_token
public static GetComponentAccessToken ( string componentAppId, string componentAppSecret, string componentVerifyTicket, int timeOut = Config.TIME_OUT ) : ComponentAccessTokenResult
componentAppId string 第三方平台appid
componentAppSecret string 第三方平台appsecret
componentVerifyTicket string 微信后台推送的ticket,此ticket会定时推送,具体请见本页末尾的推送说明
timeOut int
return Senparc.Weixin.Open.Entities.ComponentAccessTokenResult

GetComponentAccessTokenAsync() public static method

【异步方法】获取第三方平台access_token
public static GetComponentAccessTokenAsync ( string componentAppId, string componentAppSecret, string componentVerifyTicket, int timeOut = Config.TIME_OUT ) : Task
componentAppId string 第三方平台appid
componentAppSecret string 第三方平台appsecret
componentVerifyTicket string 微信后台推送的ticket,此ticket会定时推送,具体请见本页末尾的推送说明
timeOut int
return Task

GetComponentLoginPageUrl() public static method

获取授权地址
public static GetComponentLoginPageUrl ( string componentAppId, string preAuthCode, string redirectUrl ) : string
componentAppId string 第三方平台方appid
preAuthCode string 预授权码
redirectUrl string 回调URL
return string

GetJsApiTicket() public static method

文档:https://open.weixin.qq.com/cgi-bin/showdocument?action=dir_list&t=resource/res_list&verify=1&id=open1421823488&token=&lang=zh_CN 获取调用微信JS接口的临时票据 OPEN
public static GetJsApiTicket ( string authorizerAccessToken, string type = "jsapi" ) : JsApiTicketResult
authorizerAccessToken string authorizer_access_token
type string
return Senparc.Weixin.Open.Entities.JsApiTicketResult

GetJsApiTicketAsync() public static method

文档:https://open.weixin.qq.com/cgi-bin/showdocument?action=dir_list&t=resource/res_list&verify=1&id=open1421823488&token=&lang=zh_CN 【异步方法】获取调用微信JS接口的临时票据 OPEN
public static GetJsApiTicketAsync ( string authorizerAccessToken, string type = "jsapi" ) : Task
authorizerAccessToken string authorizer_access_token
type string
return Task

GetPreAuthCode() public static method

获取预授权码
public static GetPreAuthCode ( string componentAppId, string componentAccessToken, int timeOut = Config.TIME_OUT ) : PreAuthCodeResult
componentAppId string 第三方平台方appid
componentAccessToken string
timeOut int
return Senparc.Weixin.Open.Entities.PreAuthCodeResult

GetPreAuthCodeAsync() public static method

【异步方法】获取预授权码
public static GetPreAuthCodeAsync ( string componentAppId, string componentAccessToken, int timeOut = Config.TIME_OUT ) : Task
componentAppId string 第三方平台方appid
componentAccessToken string
timeOut int
return Task

QueryAuth() public static method

使用授权码换取公众号的授权信息
public static QueryAuth ( string componentAccessToken, string componentAppId, string authorizationCode, int timeOut = Config.TIME_OUT ) : QueryAuthResult
componentAccessToken string 服务开发方的access_token
componentAppId string 服务开发方的appid
authorizationCode string 授权code,会在授权成功时返回给第三方平台,详见第三方平台授权流程说明
timeOut int 代理请求超时时间(毫秒)
return QueryAuthResult

QueryAuthAsync() public static method

【异步方法】使用授权码换取公众号的授权信息
public static QueryAuthAsync ( string componentAccessToken, string componentAppId, string authorizationCode, int timeOut = Config.TIME_OUT ) : Task
componentAccessToken string 服务开发方的access_token
componentAppId string 服务开发方的appid
authorizationCode string 授权code,会在授权成功时返回给第三方平台,详见第三方平台授权流程说明
timeOut int 代理请求超时时间(毫秒)
return Task

SetAuthorizerOption() public static method

设置授权方的选项信息
public static SetAuthorizerOption ( string componentAccessToken, string componentAppId, string authorizerAppId, OptionName optionName, int optionValue, int timeOut = Config.TIME_OUT ) : WxJsonResult
componentAccessToken string 服务开发方的access_token
componentAppId string 服务开发商的appid
authorizerAppId string 授权公众号appid
optionName OptionName 选项名称
optionValue int 设置的选项值
timeOut int 代理请求超时时间(毫秒)
return Senparc.Weixin.Entities.WxJsonResult

SetAuthorizerOptionAsync() public static method

【异步方法】设置授权方的选项信息
public static SetAuthorizerOptionAsync ( string componentAccessToken, string componentAppId, string authorizerAppId, OptionName optionName, int optionValue, int timeOut = Config.TIME_OUT ) : Task
componentAccessToken string 服务开发方的access_token
componentAppId string 服务开发商的appid
authorizerAppId string 授权公众号appid
optionName OptionName 选项名称
optionValue int 设置的选项值
timeOut int 代理请求超时时间(毫秒)
return Task