Пример #1
0
        /// <summary>
        /// 删除标签
        /// </summary>
        public TagCommResult DeleteTag(string accessToken, long tagid)
        {
            string urlFormat = "https://qyapi.weixin.qq.com/cgi-bin/tag/delete?access_token={0}&tagid={1}";

            var url = string.Format(urlFormat, accessToken, tagid);
            //get
            string resultMsg = HttpHelper.HttpGet(url, "");
            //反序列化
            TagCommResult result = JsonConvert.DeserializeObject <TagCommResult>(resultMsg);

            return(result);
        }
Пример #2
0
        /// <summary>
        /// 更新标签
        /// </summary>
        public TagCommResult UpdateTag(string accessToken, TagUpdateJson tagUpdateJson)
        {
            string urlFormat = "https://qyapi.weixin.qq.com/cgi-bin/tag/update?access_token={0}";

            var url = string.Format(urlFormat, accessToken);
            //序列化
            string postData = JsonConvert.SerializeObject(tagUpdateJson);
            //post
            string resultMsg = HttpHelper.HttpPost(url, postData);
            //反序列化
            TagCommResult result = JsonConvert.DeserializeObject <TagCommResult>(resultMsg);

            return(result);
        }