设置企业号应用需要Post的数据
Example #1
0
        public void SetAppTest()
        {
            var accessToken = AccessTokenContainer.GetToken(_corpId);

            SetAppPostData date = new SetAppPostData()
                {
                    agentid = "1",
                    description = "test",
                    isreportenter = 0,
                    isreportuser = 0,
                    logo_mediaid = "1muvdK7W8cjLfNqj0hWP89-CEhZNOVsktCE1JHSTSNpzTf7cGOXyDin_ozluwNZqi",
                    name = "Test",
                    redirect_domain = "www.weiweihi.com"
                };

            var result = AppApi.SetApp(accessToken, date);

            Assert.AreEqual(result.errcode, ReturnCode_QY.请求成功);
        }
Example #2
0
        /// <summary>
        /// 设置企业号应用
        /// 此App只能修改现有的并且有权限管理的应用,无法创建新应用(因为新应用没有权限)
        /// </summary>
        /// <param name="accessToken"></param>
        /// <param name="data">设置应用需要Post的数据</param>
        /// <param name="timeOut">代理请求超时时间(毫秒)</param>
        /// <returns></returns>
        public static QyJsonResult SetApp(string accessToken, SetAppPostData data, int timeOut = Config.TIME_OUT)
        {
            string url = "https://qyapi.weixin.qq.com/cgi-bin/agent/set?access_token={0}";

            return Get.GetJson<QyJsonResult>(url);
        }
Example #3
0
        /// <summary>
        /// 设置企业号应用
        /// 此App只能修改现有的并且有权限管理的应用,无法创建新应用(因为新应用没有权限)
        /// </summary>
        /// <param name="accessToken"></param>
        /// <param name="data">设置应用需要Post的数据</param>
        /// <param name="timeOut">代理请求超时时间(毫秒)</param>
        /// <returns></returns>
        public static WxJsonResult SetApp(string accessToken, SetAppPostData data, int timeOut = Config.TIME_OUT)
        {
            string url = "https://qyapi.weixin.qq.com/cgi-bin/agent/set?access_token={0}";

            return(Get.GetJson <WxJsonResult>(url));
        }
Example #4
0
        /// <summary>
        /// 【异步方法】设置企业号应用
        /// 此App只能修改现有的并且有权限管理的应用,无法创建新应用(因为新应用没有权限)
        /// </summary>
        /// <param name="accessToken"></param>
        /// <param name="data">设置应用需要Post的数据</param>
        /// <param name="timeOut">代理请求超时时间(毫秒)</param>
        /// <returns></returns>
        public static async Task<QyJsonResult> SetAppAsync(string accessToken, SetAppPostData data, int timeOut = Config.TIME_OUT)
        {
            string url = string.Format("https://qyapi.weixin.qq.com/cgi-bin/agent/set?access_token={0}", accessToken.AsUrlData());

            return await Get.GetJsonAsync<QyJsonResult>(url);
        }
Example #5
0
        /// <summary>
        /// 设置企业号应用
        /// 此App只能修改现有的并且有权限管理的应用,无法创建新应用(因为新应用没有权限)
        /// </summary>
        /// <param name="accessToken"></param>
        /// <param name="data">设置应用需要Post的数据</param>
        /// <param name="timeOut">代理请求超时时间(毫秒)</param>
        /// <returns></returns>
        public static WxJsonResult SetApp(string accessToken, SetAppPostData data, int timeOut = Config.TIME_OUT)
        {
            string url = "https://qyapi.weixin.qq.com/cgi-bin/agent/set?access_token={0}";

            return(CommonJsonSend.Send <WxJsonResult>(accessToken, url, data, CommonJsonSendType.POST, timeOut));
        }