Instnt Print
Integrations

Java

Code example

There is no SDK for Java and none is needed: one HTTP request with a key in the header, a template name and your fields. The example below is the whole integration.

How to set it up

  1. 01Create a key in the dashboard under Keys and keep it out of your source.
  2. 02Send the request below; the answer holds the job id and its status.
  3. 03Want to know the paper moved? Poll /v1/jobs/{id}, or take an outgoing webhook.

The request

var verzoek = HttpRequest.newBuilder(URI.create("https://instntprint.com/v1/jobs"))
    .header("Content-Type", "application/json")
    .header("Authorization", "Bearer " + sleutel)
    .POST(HttpRequest.BodyPublishers.ofString("{\"printer\":\"Balie\",\"template\":\"Kassabon\",\"data\":{\"totaal\":\"3.80\",\"betaalwijze\":\"Pin\"}}"))
    .build();
var antwoord = HttpClient.newHttpClient()
    .send(verzoek, HttpResponse.BodyHandlers.ofString());