Joke Collection Website - Joke collection - How to use the WeChat public platform?

How to use the WeChat public platform?

/**

? * Create a menu

? */

Public static boolean create menu (string params) (

string access token = we chat . getaccesstoken();

string JSON str = http kit . post("/CGI-bin/menu/create? access_token=" + accessToken,params);

Map< string, object & gt map = json.parseobject (jsonstr, map.class);

Return "0". equals(map.get("errcode ")。 toString());

}

Public static void main(String[] args) {

String s = "{\" button \ ":[{\" name \ ":\ "entertainment \", \ "sub _ button \": [{\ "type \": \ "click \", \ "name \": \ " "Connotation jokes \", \ "key \": \ "m _ duanzi \"}, {\ "type \": \ "click \ ",\ "name \": \" hilarious picture \ ",\" key \ ":\" "type \": \ "click \", \ "name \ ":\" bus inquiry \ ",\" key. " M_sysmenu\"}]}, {\"name\":\ "message sample \", \ "sub _ button \": [{\ "type \": \ "click \", \"name\":\ "About the enterprise. "key \": \ "m _ imgmsg \"}, {\ "type \": \ "click \", \ "name \": \ "music message \", \ "key \": \ "m _ musicmsg \"}]

If (create menu)

LOGGER.info ("Menu created successfully!" );

} Otherwise {

LOGGER.info ("Menu creation failed!" );

}

}

Mianfa runs directly, simple!