title: Error 403 when connecting to the official Clash Royale API
body: <p>I keep getting Error 403 Invalid authorization, the token is totally correct.
  Does anyone else use the Clash API? Couldn't find any working code with it so far.</p>
  
  <p>This is the code I'm using for my test requests:</p>
  
  <pre><code>import java.io.*;
  import java.net.*;
  
  import com.google.gson.Gson;
  import com.google.gson.GsonBuilder;
  import com.google.gson.JsonElement;
  import com.google.gson.JsonParser;
  
  public class Test {
  
      private static String token = "can't show that :)";
  
      public static void main(String[] args) {
  
          try {
              URL url = new URL("https://api.clashroyale.com/v1/locations");
  
              HttpURLConnection con = (HttpURLConnection) url.openConnection();
  
              con.setRequestMethod("GET");
              con.setDoOutput(true);
              con.setRequestProperty("Authorization", "Bearer " + token);
              con.setRequestProperty("Accept", "application/json");
  
              InputStream content = (InputStream) con.getInputStream();
              BufferedReader in = new BufferedReader(new InputStreamReader(content));
  
              Gson gson = new GsonBuilder().setPrettyPrinting().create();
              JsonParser jp = new JsonParser();
              JsonElement je = jp.parse(in.readLine());
              String jsonString = gson.toJson(je);
              System.out.println(jsonString);
  
              con.disconnect();
          } catch (Exception e) {
              e.printStackTrace();
          }
      }
  }
  </code></pre>