示例#1
0
        public string GetMenuJson(IWeChatOAContext context)
        {
            IGetMenuApi api      = new GetMenuApi(context);
            var         response = api.ExecuteRawContent();

            return(response);
        }
示例#2
0
        public void TestGetMenuApi()
        {
            ICreateMenuApi api           = new CreateMenuApi(context);
            var            jsonContainer = new CreateMenuApiJsonDataContainer();

            jsonContainer.Buttons.Add(new ViewUrlButton()
            {
                Name = "历史消息", Url = "http://mp.weixin.qq.com/mp/getmasssendmsg?__biz=MzIzOTM1MDYzNw==#wechat_webview_type=1&wechat_redirect"
            });
            api.JsonData = jsonContainer;
            api.Execute();

            IGetMenuApi api2     = new GetMenuApi(context);
            var         response = api2.ExecuteRawContent();

            Assert.IsNotNull(response);
            Console.WriteLine(response);

            IDeleteMenuApi api3 = new DeleteMenuApi(context);

            api3.Execute();
        }