// Contoh kode Java untuk panggilan API
// Pastikan mengganti placeholder dengan informasi yang sesuai

import java.net.HttpURLConnection;
import java.net.URL;
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class ApiIntegration {
  public static void main(String[] args) {
    try {
      String apiUrl = "your-api-url";
      String apiKey = "your-api-key";

      URL url = new URL(apiUrl);
      HttpURLConnection connection = (HttpURLConnection) url.openConnection();
      connection.setRequestMethod("GET");
      connection.setRequestProperty("Ocp-Apim-Subscription-Key", apiKey);

      BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
      String line;
      StringBuilder response = new StringBuilder();

      while ((line = reader.readLine()) != null) {
        response.append(line);
      }
      reader.close();

      System.out.println(response.toString());
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
}