Some help regarding OAth and validation

I basically want to create a code for a “emulator game” i have which get the streamer data and twitch channels info. So basically i want query a twitch channel and get it’s info + the user’s info (the owner of the channel). Those i need.

So i followed your link and i received a token:
Your Access Key from the #url: lfx6vel#################

I guess this is the Bearer they say? So i guess i do a request for a twitch channel?

PS. I Tried use it like this

URL obj = new URL("https://api.twitch.tv/helix/search/channels?query=a_seagull");
			HttpURLConnection con = (HttpURLConnection) obj.openConnection();
			con.setRequestMethod("GET");
			con.setRequestProperty("Client-ID", "1mnq9hg20ml####");
			con.setRequestProperty("Authorization", "Bearer lfx6velftvo8####");
			con.connect();

			System.out.println(con.getResponseMessage());

But it says “Unauthorized”