Skip to main content
The Java SDK is published to Maven Central as gg.teambattles:sdk. It is generated from the OpenAPI spec with Microsoft Kiota and regenerates on every API change.

Install

Gradle:
implementation "gg.teambattles:sdk:0.1.0"
Maven:
<dependency>
  <groupId>gg.teambattles</groupId>
  <artifactId>sdk</artifactId>
  <version>0.1.0</version>
</dependency>

Authenticated first call

import gg.teambattles.sdk.TeamBattlesClientFactory;
import gg.teambattles.sdk.models.MatchesRequestBody;

var client = TeamBattlesClientFactory.create(System.getenv("TEAMBATTLES_API_KEY"));

// List the authenticated user's matches (requires matches.user_matches: read)
var body = new MatchesRequestBody();
body.setNumItems(25);
var result = client.user().matches().post(body);
for (var match : result.getPage()) {
    System.out.println(match.getId() + " " + match.getStatus());
}

Authentication

The factory wires an Authorization: Bearer tb_<your-key> header on every request. Create keys at Settings > Developer and review scopes in the authentication guide. Treat the error machine code in error responses - not the details message - as the stable programmatic contract.