java 获取微信公众号粉丝的openId

时间:2015-03-30 14:42:43   收藏:0   阅读:881
public static String getUserOpenId(String accessToken){
		String result = null;
		String requestUrl ="https://api.weixin.qq.com/cgi-bin/user/get?access_token=ACCESS_TOKEN";
		requestUrl = requestUrl.replace("ACCESS_TOKEN", accessToken);
		JSONObject jsonObject = WeixinUtil.httpRequest(requestUrl, "GET", null);
		if(null != jsonObject){
			System.out.println(jsonObject);
			System.out.println(jsonObject.get("total"));
			System.out.println(jsonObject.get("data"));
			result = jsonObject.get("data")+"";
		}
		return result;
	}

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!