This is the code. Although I can get the same error using any api tools. Such as the RESTer addon for firefox. "bot.getClientID returns the bots client id. and data.oAuth is the channels oauth code. However this code returns the userdata for the bot. Checking the exact OAuth key from my computer useing the RESTer addon for firefox (for testing endpoints) I get my own data back. If I open Twitch and click logout then it will return the data of the actual person I look up.
URL url = new URL("https://api.twitch.tv/kraken/user");
conn = (HttpURLConnection)url.openConnection();
conn.setRequestMethod("GET");
conn.setRequestProperty("Accept", "application/vnd.twitchtv.v5+json");
conn.setRequestProperty("Client-ID", bot.getClientID());
conn.setRequestProperty("Authorization", "OAuth "+data.OAuth);
conn.setConnectTimeout(3000);
conn.setDoOutput(true);
final BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
String response = reader.lines().collect(Collectors.joining());
JSONObject jsObj = new JSONObject(response);
String str = jsObj.get("_id").toString();