Fetch the repository succeeded.
This action will force synchronization from RHQYZ/DotNetCore.SKIT.FlurlHttpClient.Wechat, which will overwrite any changes that you have made since you forked the repository, and can not be recovered!!!
Synchronous operation will process in the background and will refresh the page when finishing processing. Please be patient.
基于 Flurl.Http
的企业微信 HTTP API SDK。
提示:如果你使用 Visual Studio NuGet 管理器图形化界面,请在搜索结果中勾选“包括预发行版”。
# 通过 NuGet 安装
> Install-Package SKIT.FlurlHttpClient.Wechat.Work
# 通过 dotnet-tools 安装
> dotnet add package SKIT.FlurlHttpClient.Wechat.Work
using SKIT.FlurlHttpClient.Wechat;
using SKIT.FlurlHttpClient.Wechat.Work;
var options = new WechatWorkClientOptions()
{
CorpId = "企业微信 CorpId",
AgentId = "企业微信应用的 AgentId",
AgentSecret = "企业微信应用的 Secret"
};
var client = new WechatWorkClient(options);
using SKIT.FlurlHttpClient.Wechat.Work;
using SKIT.FlurlHttpClient.Wechat.Work.Models;
/* 以获取用户信息接口为例 */
var request = new CgibinUserGetRequest()
{
AccessToken = "企业微信应用的 AccessToken",
UserId = "企业成员账号"
};
var response = await client.ExecuteCgibinUserGetAsync(request);
if (response.IsSuccessful())
{
Console.WriteLine("名称:" + response.Name);
Console.WriteLine("头像:" + response.AvatarUrl);
}
else
{
Console.WriteLine("错误代码:" + response.ErrorCode);
Console.WriteLine("错误描述:" + response.ErrorMessage);
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。