Java library for TJ, VC and DTF API interaction. Uses API version 1.6.
Library is in active development for now. If you want to start
using it immediately run mvn clean install and add the dependency:
<dependency>
<groupId>com.nllsdfx.api</groupId>
<artifactId>cmtt-sdk</artifactId>
<version>LATEST_VERSION</version>
</dependency>Or with gradle:
dependencies {
compile 'com.nllsdfx.api:cmtt-sdk:LATEST_VERSION'
}Go to your profile settings in TJ, VC, or DTF account. Scroll down to the bottom of the page and click dev tools link. Copy api token from there. You will need the copied token to create api client later.
Create you client using following code:
// creates TJ client
TJApiClient client = new TJApiClient("token from the previous step here");
// DTF client
DTFApiClient client = new DTFApiClient("token");
// VC client
VCApiClient client = new VCApiClient("token");You can find full list of API here
Here is a quick example of how you can do an api call:
TJApiClient client = new TJApiClient("token");
// Gets entry (content/article/post) with id 93120 from TJ
Entry entry = client.entries().get().by("93120").execute();
Assert.assertEquals("93120", entry.getId());
Assert.assertEquals("Женя Кузьмин", entry.getAuthor().getName())