Where to get documentation on the SonarQube API for calling from Java

Hi there
Please can someone help me
I want to write a Java program to retrieve a list of issues for a Project
Unfortunately, the API documentation only shows how to use the Curl command
That is not possible when running in Java on a windows machine
I have spent a week trying to figure out how to write a client and keep getting authentication issues for each different client I tried to write

Is there a detailed document of the API that covers how to pass my Token in a parameter when doing an API call in Java

Has someone written something similar that works?

regards
Nico

Using only the API in the JRE:

    String server = "myserver";
    String token = "mytoken:"; // note the ':' after the token

    URL url = new URL(server + "/api/issues/search");
    HttpURLConnection con = (HttpURLConnection) url.openConnection();
    con.setRequestMethod("GET");
    con.setRequestProperty("Authorization", "Basic " + Base64.getEncoder().encodeToString((token).getBytes()));

    System.out.println(con.getResponseCode());
    try (BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()))) {
      String inputLine;
      while ((inputLine = in.readLine()) != null) {
        System.out.println(inputLine);
      }
    }