获取微信菜单列表,程序如下:
String urlStr="https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=********&secret=e2c5*****8";
String str=Request.Get(urlStr).execute().returnContent().asString(Charset.forName("UTF-8"));
System.out.println("str---"+str);
// String str1 = str.substring(17, 174);
String[] ss = str.split("\"");
String str3 = ss[3];
System.out.println("str3---"+str3);
String accesstoken=str3;
String _str=Request.Get("https://api.weixin.qq.com/cgi-bin/menu/get?access_token="+accesstoken).execute().returnContent().asString(Charset.forName("UTF-8"));
System.out.println("menu---"+_str);
运行结果如下:str3---33_KJGBe75YNZU4kO1Tyb0jipn5ydEs3DUyviv4G_s0wa-FfG3GMcW4ZcYkBm_rbNYq5sDpuDhqghuHv3D6HZ59AFY6PeI-gyx4A5fU2BKs9SGtIOgkJuMCji8caL_JRv6wmz1KxazPuYl9yQPSWSYaAAAHDJ
menu---{"errcode":48001,"errmsg":"api unauthorized hints: [wGgc36aLRa-A_2Wma!]"}这个错误如何解决?