For your first question,
Where is the API token for developers?
The API token can be copied from your account details page:

For the second question,
Example of using the API in Java.
IBM Quantum API is a RESTful API. It can be consumed the same way as any RESTful API using a REST client. And when it comes to Java, there are many options to choose from to build a REST client. This answer from StackOverflow contains some good options. However, if you are building your solution using a Java Framework, most probably you will find it supports consuming REST APIs. It should be your first option.
Anyway, the following is a simple example using Spring's RestTemplate. The code does not follow the best practices (e.g., no error handling). It is for demonstration only:
RestTemplate restTemplate = new RestTemplate();
String baseUrl = "https://api.quantum-computing.ibm.com/v2";
// Login
URI loginUrl = UriComponentsBuilder.fromUriString(baseUrl)
.path("/users/loginWithToken")
.buildAndExpand()
.toUri();
LoginPayload payload = new LoginPayload();
payload.setApiToken("*********");
HttpEntity<LoginPayload> request = new HttpEntity<>(payload);
JsonNode loginResponse = restTemplate.postForObject(loginUrl, request, JsonNode.class);
String accessToken = loginResponse.get("id").asText();
// Get Providers Information
URI providersInfoUrl = UriComponentsBuilder.fromUriString(baseUrl)
.path("/Network")
.queryParam("access_token", accessToken)
.buildAndExpand()
.toUri();
// Parse the response to get list of devices
JsonNode response = restTemplate.getForObject(providersInfoUrl, JsonNode.class);
for(JsonNode node : response) {
if(node.get("name").asText().equals("ibm-q")) {
JsonNode devices = node.get("groups").get("open").get("projects").get("main").get("devices");
for(JsonNode device : devices) {
System.out.println(device.get("name"));
}
}
}
Finally, if you plan to support checking the job status in your solution then you will need to support WebSocket also.