C# Class Senparc.Weixin.QY.CommonAPIs.CommonApi

ファイルを表示 Open project: JeffreySu/WeiXinMPSDK Class Usage Examples

Public Methods

Method Description
ConvertToOpenId ( string accessToken, string userId, string agentId = null, int timeOut = Config.TIME_OUT ) : ConvertToOpenIdResult

userid转换成openid接口

ConvertToOpenIdAsync ( string accessToken, string userId, string agentId = null, int timeOut = Config.TIME_OUT ) : Task

【异步方法】userid转换成openid接口

ConvertToUserId ( string accessToken, string openId, int timeOut = Config.TIME_OUT ) : ConvertToUserIdResult

openid转换成userid接口

ConvertToUserIdAsync ( string accessToken, string openId, int timeOut = Config.TIME_OUT ) : Task

【异步方法】openid转换成userid接口

CreateMenu ( string accessToken, int agentId, ButtonGroup buttonData, int timeOut = Config.TIME_OUT ) : QyJsonResult

创建菜单

DeleteMenu ( string accessToken, int agentId ) : QyJsonResult

删除菜单

DeleteMenuAsync ( string accessToken, int agentId ) : Task

【异步方法】删除菜单

GetCallBackIp ( string accessToken ) : GetCallBackIpResult

获取微信服务器的ip段

GetCallBackIpAsync ( string accessToken ) : Task

【异步方法】获取微信服务器的ip段

GetMenu ( string accessToken, int agentId ) : GetMenuResult

获取当前菜单,如果菜单不存在,将返回null

GetMenuFromJsonResult ( GetMenuResultFull resultFull ) : GetMenuResult

根据微信返回的Json数据得到可用的GetMenuResult结果

GetProviderToken ( string corpId, string providerSecret, int timeOut = Config.TIME_OUT ) : ProviderTokenResult

获取应用提供商凭证

GetProviderTokenAsync ( string corpId, string providerSecret, int timeOut = Config.TIME_OUT ) : Task

【异步方法】获取应用提供商凭证

GetTicket ( string corpId, string corpSecret ) : JsApiTicketResult

获取调用微信JS接口的临时票据

GetTicketAsync ( string corpId, string corpSecret ) : Task

【异步方法】获取调用微信JS接口的临时票据

GetToken ( string corpId, string corpSecret ) : AccessTokenResult

获取AccessToken

GetTokenAsync ( string corpId, string corpSecret ) : Task

获取AccessToken

Private Methods

Method Description
GetMenuFromJson ( string jsonString ) : GetMenuResult
GetSingleButtonFromJsonObject ( object>.Dictionary objs ) : SingleClickButton

Method Details

ConvertToOpenId() public static method

userid转换成openid接口
public static ConvertToOpenId ( string accessToken, string userId, string agentId = null, int timeOut = Config.TIME_OUT ) : ConvertToOpenIdResult
accessToken string
userId string 企业号内的成员id
agentId string 需要发送红包的应用ID,若只是使用微信支付和企业转账,则无需该参数
timeOut int
return Senparc.Weixin.QY.Entities.ConvertToOpenIdResult

ConvertToOpenIdAsync() public static method

【异步方法】userid转换成openid接口
public static ConvertToOpenIdAsync ( string accessToken, string userId, string agentId = null, int timeOut = Config.TIME_OUT ) : Task
accessToken string
userId string 企业号内的成员id
agentId string 需要发送红包的应用ID,若只是使用微信支付和企业转账,则无需该参数
timeOut int
return Task

ConvertToUserId() public static method

openid转换成userid接口
public static ConvertToUserId ( string accessToken, string openId, int timeOut = Config.TIME_OUT ) : ConvertToUserIdResult
accessToken string
openId string
timeOut int
return Senparc.Weixin.QY.Entities.ConvertToUserIdResult

ConvertToUserIdAsync() public static method

【异步方法】openid转换成userid接口
public static ConvertToUserIdAsync ( string accessToken, string openId, int timeOut = Config.TIME_OUT ) : Task
accessToken string
openId string
timeOut int
return Task

CreateMenu() public static method

创建菜单
public static CreateMenu ( string accessToken, int agentId, ButtonGroup buttonData, int timeOut = Config.TIME_OUT ) : QyJsonResult
accessToken string
agentId int
buttonData Senparc.Weixin.QY.Entities.Menu.ButtonGroup 菜单内容
timeOut int 代理请求超时时间(毫秒)
return Senparc.Weixin.Entities.QyJsonResult

DeleteMenu() public static method

删除菜单
public static DeleteMenu ( string accessToken, int agentId ) : QyJsonResult
accessToken string 调用接口凭证
agentId int 企业应用的id,整型。可在应用的设置页面查看
return Senparc.Weixin.Entities.QyJsonResult

DeleteMenuAsync() public static method

【异步方法】删除菜单
public static DeleteMenuAsync ( string accessToken, int agentId ) : Task
accessToken string 调用接口凭证
agentId int 企业应用的id,整型。可在应用的设置页面查看
return Task

GetCallBackIp() public static method

获取微信服务器的ip段
public static GetCallBackIp ( string accessToken ) : GetCallBackIpResult
accessToken string
return Senparc.Weixin.QY.Entities.GetCallBackIpResult

GetCallBackIpAsync() public static method

【异步方法】获取微信服务器的ip段
public static GetCallBackIpAsync ( string accessToken ) : Task
accessToken string
return Task

GetMenu() public static method

获取当前菜单,如果菜单不存在,将返回null
public static GetMenu ( string accessToken, int agentId ) : GetMenuResult
accessToken string 调用接口凭证
agentId int 企业应用的id,整型。可在应用的设置页面查看
return Senparc.Weixin.QY.Entities.GetMenuResult

GetMenuFromJsonResult() public static method

根据微信返回的Json数据得到可用的GetMenuResult结果
public static GetMenuFromJsonResult ( GetMenuResultFull resultFull ) : GetMenuResult
resultFull GetMenuResultFull
return Senparc.Weixin.QY.Entities.GetMenuResult

GetProviderToken() public static method

获取应用提供商凭证
public static GetProviderToken ( string corpId, string providerSecret, int timeOut = Config.TIME_OUT ) : ProviderTokenResult
corpId string
providerSecret string
timeOut int
return Senparc.Weixin.QY.Entities.ProviderTokenResult

GetProviderTokenAsync() public static method

【异步方法】获取应用提供商凭证
public static GetProviderTokenAsync ( string corpId, string providerSecret, int timeOut = Config.TIME_OUT ) : Task
corpId string
providerSecret string
timeOut int
return Task

GetTicket() public static method

获取调用微信JS接口的临时票据
public static GetTicket ( string corpId, string corpSecret ) : JsApiTicketResult
corpId string
corpSecret string
return Senparc.Weixin.QY.Entities.JsApiTicketResult

GetTicketAsync() public static method

【异步方法】获取调用微信JS接口的临时票据
public static GetTicketAsync ( string corpId, string corpSecret ) : Task
corpId string
corpSecret string
return Task

GetToken() public static method

获取AccessToken
public static GetToken ( string corpId, string corpSecret ) : AccessTokenResult
corpId string
corpSecret string
return Senparc.Weixin.QY.Entities.AccessTokenResult

GetTokenAsync() public static method

获取AccessToken
public static GetTokenAsync ( string corpId, string corpSecret ) : Task
corpId string
corpSecret string
return Task