Overview - what this Library is?
We want to provide our clients a way to use our system however they like. That is why we have introduced the Integration Libraries - a group of functions and declarations to help you implement our API to your system.
How to download and implement the Library
After you have downloaded the library (which is a whole project), you might want to put it in your Java directory to have a quick and easy access to it manually or through your own code.
We will be using Eclipse. We also suggest creating a Maven project to easily import external packages needed to start using our library.
Extract the whole project to your existing project directory. If you do not have a project set up yet, please do this now. One of the ways to include our library in your project would be selecting the Import... option available under right-click on one of your project folders and selecting the File System import source type:
The image below shows a sample Maven project with our Library all set up:
You will be using the import functionality to access any classes and methods that you need. The code below is a standard classes import that will be enough for us to start working with the library:
We are also going to need some external dependencies of fastxml.jackson. You can import them by adding the following code to the dependencies section of your pom.xml file:
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-core --> <dependency> <groupId>com.fasterxml.jackson.core<groupId> <artifactId>jackson-core</artifactId> <version>2.8.7</version> </dependency> <!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind --> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> <version>2.8.7</version> </dependency>
How to start working with the Library on your project
All of our library's methods are available using the static class named API. Whether you want to send an email or modify your template, you can do it using the API class. You can use the ApiTypes class to create the desired object that would be used as a parameter in some calls. Refer to our API documentation or use Eclipse's auto-suggestion functionality. Use whichever you like.
But first of all, we need to set up an ApiKey, that is the unique identifier of your account. You can do this in two ways:
First option: open up API.java in your editor. Then, in the API class, you can find two fields API_KEY and API_URI. Change the former's value to your ApiKey available to you here. Don't mind the API_URI field, it is best to leave it untouched.
Second option: simply overwrite the API_KEY field's value of the API class at the start of your code. Remember to import the API class first:
All code samples are licensed under MIT license.