Java based SDK for the Nitrapi
Clone or download
bitowl and BirknerAlex Add missing endpoints (#16)
* Add dependency to @nullable annotation

* Remove plugin system

* Add nullable to some fields

* Add bouncer endpoints

* Add update profile endpoint

* Make some parameters optional

* Add countries and states

* Add timezones

* Make more parameters optional

* Return maps

* Updating donations needs user update token

* Return service id when ordering

* Add update status

* Add auto extension duration

* Test for null in service properties

* Add @nullable to Gameserver and Cloudserver properties

* Make ProductionHttpClient extendable

* Test game for null

* Add detailed profile

* Add rescue mode
Latest commit 6c63f5e Mar 19, 2018

README.md

Nitrapi-Java

Java based SDK for the Nitrapi RESTful API.

Usage

Maven

Add the following to the <dependencies> section of your pom.xml:

<dependency>
    <groupId>net.nitrado</groupId>
    <artifactId>nitrapi</artifactId>
    <version>1.2.0</version>
</dependency>

Gradle

Add this to your app build.gradle:

dependencies {
    implementation 'net.nitrado:nitrapi:1.2.0'
}

Example

Nitrapi api = new Nitrapi("<access token>");
try {
    Service[] services = api.getServices();
    // ...
} catch (NitrapiErrorException e) {
    // There was an error in our request to the api.
    // ...
} catch (NitrapiAccessTokenInvalidException e) {
    // The access token is no longer valid.
    // ...
} catch (NitrapiHttpException e) {
    // There was an error connecting to the api.
    // ...
} catch (NitrapiConcurrencyException e) {
    // The same action is already running.
    // ...
} catch (NitrapiMaintenanceException e) {
    // The Nitrapi is currently down for maintenance.
    // ...
}