The Empyr Java library provides integration access to the Empyr API.
- ApacheHttp - Apache Commons HTTPClient 3
- Jackson - Jackson Project (JSON mapping)
import com.empyr.api.EmpyrClient;
import com.empyr.api.model.RestApplication;
import com.empyr.api.model.RestResponse;
public class ClientQuickStart
{
public static void main( String[] args )
{
EmpyrClient client = new EmpyrClient( "the_public_key", "the_private_key" );
RestResponse<RestApplication> response = client.getApplicationInfo();
if( response.meta.code == 200 )
{
System.out.println( "Application id: " + response.response.id );
}else
{
System.out.println( "Unexpected API response: " + response );
}
}
}
With Maven installed, this package can be built simply by running this command: mvn package The resulting jar file will be producd in the directory named "target".
Maven Central, which should be enabled by default. No additional repositories are required.
<dependency>
<groupId>com.empyr</groupId>
<artifactId>client</artifactId>
<version>PUT VERSION HERE</version>
</dependency>
Unit tests for this project are performed as a separate private project that runs against our development servers. These tests would fail in your local environment so they are not available for public consumption.
See the LICENSE file.