Java Client

2 July 2025

Script Examples

You can download a comprehensive test/example script which demonstrates all of the key features of the API here.

Please Note: As the test script performs domain registrations and renewals it must only be run against the OTE environment.

Please refer to the API Reference guide for documentation on the various APIs available.

java
<dependency>
    <groupId>com.netistrar</groupId>
    <artifactId>reseller-api</artifactId>
    <version>1.34</version>
</dependency>

For all other environments please download and install the following JARs in your enviornment

Basic Usage

The client provides a simple object oriented library for accessing all of the REST API methods. Assuming you have installed via composer you would create an API provider using the following code.

java
import com.google.gson.Gson;
import netistrar.clientapi.APIProvider;

String endpoint = "API_ENDPOINT_URL";
String apiKey = "YOURAPIKEY";
String apiSecret = "YOURAPISECRET";

APIProvider provider = new APIProvider(endpoint, apiKey, apiSecret);

The API_ENDPOINT_URL referenced above should be set to one of the following values:

OTE: https://restapi.netistrar-ote.uk

Production: https://restapi.netistrar.com

Your API Key and Secret can be looked up in My Account -> API Settings in the Netistrar control panel.

You can then access the various APIs using a convention which matches the REST path for each API as described in the API Reference guide

e.g. the ping method on the Utility API would be accessed using the following method on the provider object.

java
provider.utility().ping();
Note on Descriptor Objects

Many of the API methods require complex structures which are supplied using descriptor objects. As many of these contain a number of optional properties these typically provide a blank and a full constructor for all properties as well as setter chaining for more terse object construction.

e.g. the hintedAvailability method on the Domains API accepts a DomainNameAvailabilityDescriptor object as it’s main object. This object only requires the searchString member to be supplied. Suppose you also wanted to set the suggestions boolean to true as well you could do either of the following.

java
DomainNameAvailabilityDescriptor descriptor = new DomainNameAvailabilityDescriptor("test", null, null, true, null);

DomainAvailabilityResults results = provider.domains().hintedAvailability($descriptor);

or

java
DomainNameAvailabilityDescriptor descriptor = new DomainNameAvailabilityDescriptor().setSearchString("test").setSuggestions(true);

DomainAvailabilityResults results = provider.domains().hintedAvailability($descriptor);

Examples

You can download a comprehensive test/example script which demonstrates all of the key features of the API here.

Please Note: As the test script performs domain registrations and renewals it must only be run against the OTE environment.

Please refer to the API Reference guide for documentation on the various APIs available.