Exemple #1
0
        /// <summary>
        ///     增加分组
        /// </summary>
        /// <param name="accessTokenOrAppId"></param>
        /// <param name="addGroupData">增加分组需要Post的数据</param>
        /// <returns></returns>
        public static AddGroupResult AddGroup(string accessTokenOrAppId, AddGroupData addGroupData)
        {
            return ApiHandlerWapper.TryCommonApi(accessToken =>
            {
                var url = $"https://api.weixin.qq.com/merchant/group/add?access_token={accessToken}";
                return CommonJsonSend.Send<AddGroupResult>(accessToken, url, addGroupData);
            }, accessTokenOrAppId);

            //var urlFormat = "https://api.weixin.qq.com/merchant/group/add?access_token={0}";

            //return CommonJsonSend.Send<AddGroupResult>(accessToken, urlFormat, addGroupData);
        }
Exemple #2
0
        /// <summary>
        /// 增加分组
        /// </summary>
        /// <param name="accessToken"></param>
        /// <param name="addGroupData">增加分组需要Post的数据</param>
        /// <returns></returns>
        public static AddGroupResult AddGroup(string accessToken, AddGroupData addGroupData)
        {
            var urlFormat = "https://api.weixin.qq.com/merchant/group/add?access_token={0}";

            return CommonJsonSend.Send<AddGroupResult>(accessToken, urlFormat, addGroupData);
        }
Exemple #3
0
        /// <summary>
        /// 【异步方法】增加分组
        /// </summary>
        /// <param name="accessToken"></param>
        /// <param name="addGroupData">增加分组需要Post的数据</param>
        /// <returns></returns>
        public static async Task<AddGroupResult> AddGroupAsync(string accessToken, AddGroupData addGroupData)
        {
            var urlFormat = "https://api.weixin.qq.com/merchant/group/add?access_token={0}";

            return await Senparc.Weixin.CommonAPIs.CommonJsonSend.SendAsync<AddGroupResult>(accessToken, urlFormat, addGroupData);
        }