Java Client

Step 1 - Add the Client with the Maven Package Manager

Add the Java client to your Maven POM file:

Add a reference to the repository (we use Jitpack to dynamically compile the library from Github source):

<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>

Add a reference to the dependency:

<dependencies>
<dependency>
<groupId>com.github.Cloudmersive</groupId>
<artifactId>Cloudmersive.APIClient.Java</artifactId>
<version>v1.87</version>
</dependency>
</dependencies>


Step 2 - Create an API Client object with API Key

Import the API Client package by adding this line to the top of your .java file:

import com.cloudmersive.client.*;
import com.cloudmersive.client.model.*;
import com.cloudmersive.client.invoker.*;
 

Get your API Key (available in your Account Dashboard) and instantiate the API Client object:

ApiClient client = new ApiClient();
client.addDefaultHeader("Apikey", "YOUR_API_KEY_HERE");


Step 3 - Call an API

Let's try calling the email validation API to check if this email address exists:
try
{
// Email API

EmailApi api = new EmailApi(client);


FullEmailValidationResponse result = api.emailFullValidation("support@cloudmersive.com");
System.out.println("Result: " + result.isValidAddress().toString() + " - " + result.getMailServerUsedForValidation());
}
catch (Exception e)
{
System.out.println("Error:" + e.toString() + e.getMessage() );
}


Sample Application

Download Sample

You can also download our sample application from GitHub.

50,000 free API calls/month, no credit card required

Get started now!