Пример #1
0
 public static WechatResponseWrapper CreateCustomMenu(String acessToken, WechatMenuButtonSet menu) {
     //https://api.weixin.qq.com/cgi-bin/menu/create?access_token=ACCESS_TOKEN
     String reqUrl = String.Format("https://api.weixin.qq.com/cgi-bin/menu/create?access_token={0}", acessToken);
     JsonSerializerSettings settings = new JsonSerializerSettings();
     settings.NullValueHandling = NullValueHandling.Ignore;
     String respText = new Curl().Post(reqUrl, JsonConvert.SerializeObject(menu, settings));
     return new WechatResponseWrapper(reqUrl, respText);
 }
Пример #2
0
 public JsonResult CreateMenu(WechatMenuButton button) {
     var buttonSet = new WechatMenuButtonSet();
     buttonSet.button.Add(button);
     _wechatCustomApi.CreateCustomMenu(buttonSet);
     return Json(null);
 }
Пример #3
0
 public void CreateCustomMenu(WechatMenuButtonSet buttons) {
     var result = WechatBasicApi.CreateCustomMenu(GetAccessToken().access_token, buttons);
     result.ThrowifFailed();
 }