Java library for
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.


A library to view, create and update infographics on For details on the different calls see


To make the API calls, use the net.infogram.api.InfogramAPI class. The response is wrapped in an appropriate Response object, containing the metadata and the body of the response. The response body can be accessed via a

import net.infogram.api.InfogramAPI;
import net.infogram.api.response.Response;
// ...

InfogramAPI infogram = new InfogramAPI(YOUR_API_KEY, YOUR_API_SECRET);

try {
    Response response = infogram.sendRequest("GET", "infographics", null);

    if (response.isSuccessful()) {
        InputStream is = response.getResponseBody();

        // ...
    } else {
        String errmsg = String.format("The server returned %d %s", response.getHttpStatusCode(), response.getHttpStatusMessage());
} catch (IOException e) {
    System.err.println("There was a problem connecting to the server");

To make the calls asynchronously, use the you can wrap a Future around the sendRequest() method. An example is given below.

import net.infogram.api.InfogramAPI;
import net.infogram.api.response.Response;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Callable;
import java.util.concurrent.FutureTask;

// ...

InfogramAPI infogram = new InfogramAPI(YOUR_API_KEY, YOUR_API_SECRET);

FutureTask responseFuture = new FutureTask<Response>(new Callable<Response>() {
    public Response call() throws Exception {
        return sendRequest("GET", "infographics", null);

ExecutorService executor = Executors.newCachedThreadPool();

// ...

Response response = responseFuture.get();

// ...


More samples can be found in infogram-java-samples project