Skip to main content

Installation

Maven users

Add this dependency to your project’s POM:
<dependency>
  <groupId>org.openapitools</groupId>
  <artifactId>openapi-java-client</artifactId>
  <version>3.1.0</version>
  <scope>compile</scope>
</dependency>

Gradle users

Add this dependency to your project’s build file:
repositories {
    mavenCentral()     // Needed if the 'openapi-java-client' jar has been published to maven central.
    mavenLocal()       // Needed if the 'openapi-java-client' jar has been published to the local maven repo.
}

dependencies {
     implementation "org.openapitools:openapi-java-client:3.1.0"
}

Usage

import io.tradewatch.client.*;
import io.tradewatch.client.auth.*;
import io.tradewatch.client.model.*;
import io.tradewatch.client.api.AccountApi;

public class AccountApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        defaultClient.setBasePath("https://api.tradewatch.io");
        
        // Configure API key authorization: api_key_query
        ApiKeyAuth api_key_query = (ApiKeyAuth) defaultClient.getAuthentication("api_key_query");
        api_key_query.setApiKey("YOUR API KEY");

        AccountApi apiInstance = new AccountApi(defaultClient);
        Integer limit = 56; // Integer | 
        AccountUsageStatisticsInterval interval = AccountUsageStatisticsInterval.fromValue("1h"); // AccountUsageStatisticsInterval | 
        try {
            AccountUsageStatistics result = apiInstance.getUsage(limit, interval);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountApi#getUsage");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

More Examples

Find more examples in our GitHub repository.