具体参照微信官方文档。
创建用户分组
/**
* 创建分组
* @param groupName 分组名
* @return Integer 分组ID
*/
public static Integer createPrizeDrawGroup(String groupName){
String url = "https://api.weixin.qq.com/cgi-bin/groups/create?access_token="+getGlobalToken();
JSONObject json = new JSONObject();
JSONObject jsonParent = new JSONObject();
json.put("name", groupName);
jsonParent.put("group", json);
JSONObject demoJson = null;
try {
URL urlGet = new URL(url);
HttpURLConnection http = (HttpURLConnection) urlGet.openConnection();
http.setRequestMethod("POST"); // 必须是POST方式请求
http.setRequestProperty("Content-Type","application/x-www-form-urlencoded");
http.setDoOutput(true);
http.setDoInput(true);
http.getOu