public WeixinResult Update() { string url = WeCorpUtil.GetCorpUrl(WeCorpConst.UPDATE_DEPARTMENT, WeixinSettings.Current.CorpUserManagerSecret); return(WeUtil.PostToUri(url, this.WriteJson(WeConst.WRITE_SETTINGS), new WeixinResult())); }
public WeThirdPartyGetAgentResponse get_agent() { string url = WeCorpUtil.GetCorpUrl(WeThirdPartyConst.GET_AGENT, WeixinSettings.Current.CorpUserManagerSecret); var result = WeUtil.PostToUri(url, this.WriteJson(), new WeThirdPartyGetAgentResponse()); return(result); }
public WeThirdPartyCorpTokenResponse get_corp_token() { string url = WeCorpUtil.GetCorpUrl(WeThirdPartyConst.CORP_TOKEN, WeixinSettings.Current.CorpUserManagerSecret); var result = WeUtil.PostDataToUri(url, this.WriteJson(), new WeThirdPartyCorpTokenResponse()); return(result); }
public WeThirdPartyAuthInfosResponse get_auth_info() { string url = WeCorpUtil.GetCorpUrl(WeThirdPartyConst.AUTH_INFO, WeixinSettings.Current.CorpUserManagerSecret); var result = WeUtil.PostDataToUri(url, this.WriteJson(), new WeThirdPartyAuthInfosResponse()); return(result); }
internal static CorpDepartmentCollection GetDepartmentList() { string url = WeCorpUtil.GetCorpUrl(WeCorpConst.QUERY_DEPARTMENT, WeixinSettings.Current.CorpUserManagerSecret); CorpDepartmentCollection collection = WeUtil.GetFromUri <CorpDepartmentCollection>(url); return(collection); }
public static List <CorpAppSimpleInfo> GetAppList() { string url = WeCorpUtil.GetCorpUrl(WeCorpConst.AGENT_LIST, WeixinSettings.Current.CorpUserManagerSecret); var list = WeUtil.GetFromUri(url, new CorpAppList()); return(list.AgentList); }
internal static CorpTagList GetTagList() { string url = WeCorpUtil.GetCorpUrl(WeCorpConst.QUERY_TAG, WeixinSettings.Current.CorpUserManagerSecret); CorpTagList list = WeUtil.GetFromUri(url, new CorpTagList()); return(list); }
public WeixinResult Update() { string url = WeCorpUtil.GetCorpUrl(WeCorpConst.AGENT_SET, WeixinSettings.Current.CorpUserManagerSecret); CorpAppUpdateInfo updateInfo = new CorpAppUpdateInfo(this); WeixinResult result = WeUtil.PostToUri(url, updateInfo.WriteJson(), new WeixinResult()); return(result); }
public static WeixinResult BatchDelete(IEnumerable <string> userIds) { TkDebug.AssertArgumentNull(userIds, "userIds", null); CorpUserIdList id = new CorpUserIdList(userIds); string url = WeCorpUtil.GetCorpUrl(WeCorpConst.BATCH_DELETE_USER, WeixinSettings.Current.CorpUserManagerSecret); return(WeUtil.PostToUri(url, id.WriteJson(WeConst.WRITE_SETTINGS), new WeixinResult())); }
public static string get_suite_token(string suiteTicket) { TkDebug.AssertArgumentNullOrEmpty(suiteTicket, "suiteTicket", null); string url = WeCorpUtil.GetCorpUrl(WeThirdPartyConst.SUITE_TOKEN, WeixinSettings.Current.CorpUserManagerSecret); WeThirdPartySuiteTokenRequest request = new WeThirdPartySuiteTokenRequest(suiteTicket); var result = WeUtil.PostDataToUri(url, request.WriteJson(), new WeThirdPartySuiteTokenResponse()); return(result.SuiteAccessToken); }
public static string get_pre_auth_code(params string[] ids) { TkDebug.AssertArgumentNull(ids, "ids", null); string url = WeCorpUtil.GetCorpUrl(WeThirdPartyConst.PRE_AUTH_CODE, WeixinSettings.Current.CorpUserManagerSecret); WeThirdPartyPreAuthCodeRequest request = new WeThirdPartyPreAuthCodeRequest(ids); var result = WeUtil.PostToUri(url, request.WriteJson(), new WeThirdPartyPreAuthCodeResponse()); return(result.PreAuthCode); }
public CorpMessageResult Send(int appId) { AgentId = appId; string secret = WeixinSettings.Current.GetCorpSecret(appId); string url = WeCorpUtil.GetCorpUrl(WeCorpConst.MESSAGE_URL, secret); CorpMessageResult result = new CorpMessageResult(); result = WeUtil.PostToUri(url, ToJson(), result); return(result); }
public static WeThirdPartyPermanentCodeResponse get_permanent_code(string authCode) { TkDebug.AssertArgumentNullOrEmpty(authCode, "authCode", null); string url = WeCorpUtil.GetCorpUrl(WeThirdPartyConst.PERMANENT_CODE, WeixinSettings.Current.CorpUserManagerSecret); WeThirdPartyPermanentCodeRequest request = new WeThirdPartyPermanentCodeRequest(authCode); var result = WeUtil.PostDataToUri(url, request.WriteJson(), new WeThirdPartyPermanentCodeResponse()); return(result); }
public static WeixinResult set_agent(string authCorpid, string permanentCode, WeThirdPartyAgentSet agent) { TkDebug.AssertArgumentNullOrEmpty(authCorpid, "authCorpid", null); TkDebug.AssertArgumentNullOrEmpty(permanentCode, "permanentCode", null); TkDebug.AssertArgumentNull(agent, "agent", null); string url = WeCorpUtil.GetCorpUrl(WeThirdPartyConst.SET_AGENT, WeixinSettings.Current.CorpUserManagerSecret); WeThirdPartySetAgentRequest request = new WeThirdPartySetAgentRequest(authCorpid, permanentCode, agent); var result = WeUtil.PostToUri(url, request.WriteJson(), new WeixinResult()); return(result); }
public CorpTagUserResult RemoveMembers(IEnumerable <string> userList, IEnumerable <int> partyList) { TkDebug.AssertArgument(userList != null || partyList != null, "userList", "参数userList或者partyList不能全为空", this); CorpPostTagUser postData = new CorpPostTagUser(Id, userList, partyList); string url = WeCorpUtil.GetCorpUrl(WeCorpConst.REMOVE_TAG_USER, WeixinSettings.Current.CorpUserManagerSecret); CorpTagUserResult result = WeUtil.PostToUri(url, postData.WriteJson(WeConst.WRITE_SETTINGS), new CorpTagUserResult()); return(result); }
public static CorpTag Create(string name) { TkDebug.AssertArgumentNullOrEmpty(name, "name", null); CorpTag data = new CorpTag { Name = name }; string url = WeCorpUtil.GetCorpUrl(WeCorpConst.CREATE_TAG, WeixinSettings.Current.CorpUserManagerSecret); return(WeUtil.PostToUri(url, data.WriteJson(WeConst.WRITE_SETTINGS), data)); }
public static CorpDepartment Create(int parentId, string name, int order) { TkDebug.AssertArgumentNullOrEmpty(name, "name", null); CorpDepartment data = new CorpDepartment { Name = name, ParentId = parentId, Order = order }; string url = WeCorpUtil.GetCorpUrl(WeCorpConst.CREATE_DEPARTMENT, WeixinSettings.Current.CorpUserManagerSecret); return(WeUtil.PostToUri(url, data.WriteJson(WeConst.WRITE_SETTINGS), data)); }
public static InviteType Invite(string userId, string tips) { TkDebug.AssertArgumentNullOrEmpty(userId, "userId", null); TkDebug.AssertArgumentNullOrEmpty(tips, "tips", null); CorpInviteRequest request = new CorpInviteRequest(userId) { InviteTips = tips }; string url = WeCorpUtil.GetCorpUrl(WeCorpConst.INVITE_SEND, WeixinSettings.Current.CorpUserManagerSecret); var result = WeUtil.PostToUri(url, request.WriteJson(), new CorpInviteResult()); return(result.Type); }