Workflows and integrations
Web services, processes, and connections that fit your landscape.
Call the OTOBO API from Java with java.net.http.HttpClient (Java 11 or newer). There is no library to deploy. The examples below are the whole client: a bearer token and JSON.
Replace YOUR_TOKEN with a token from Admin → API or from an agent’s personal API token. The base URL on this OTOBO system is https://helpdesk.example.com/otobo/otai-api.pl/v1. How tokens expire and how rights follow the user is on the authentication page.
Fields and errors: Tickets.
import java.net.URI;import java.net.http.HttpClient;import java.net.http.HttpRequest;import java.net.http.HttpResponse;
HttpClient client = HttpClient.newHttpClient();String payload = """ { "title": "Printer offline", "queue": "Service Desk", "state": "new", "priority": "3 normal", "customerUser": "max@example.com", "article": { "subject": "Printer offline", "body": "Floor 2, the device shows no paper path.", "mimeType": "text/plain" } } """;HttpRequest.BodyPublisher body = HttpRequest.BodyPublishers.ofString(payload);HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://helpdesk.example.com/otobo/otai-api.pl/v1/tickets")) .header("Authorization", "Bearer YOUR_TOKEN") .header("Accept", "application/json") .method("POST", body) .build();HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());System.out.println(response.body());Fields and errors: FAQ.
import java.net.URI;import java.net.http.HttpClient;import java.net.http.HttpRequest;import java.net.http.HttpResponse;
HttpClient client = HttpClient.newHttpClient();HttpRequest.BodyPublisher body = HttpRequest.BodyPublishers.noBody();HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://helpdesk.example.com/otobo/otai-api.pl/v1/faqs?query=vpn&limit=20")) .header("Authorization", "Bearer YOUR_TOKEN") .header("Accept", "application/json") .method("GET", body) .build();HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());System.out.println(response.body());Fields and errors: Queues.
import java.net.URI;import java.net.http.HttpClient;import java.net.http.HttpRequest;import java.net.http.HttpResponse;
HttpClient client = HttpClient.newHttpClient();HttpRequest.BodyPublisher body = HttpRequest.BodyPublishers.noBody();HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://helpdesk.example.com/otobo/otai-api.pl/v1/queues")) .header("Authorization", "Bearer YOUR_TOKEN") .header("Accept", "application/json") .method("GET", body) .build();HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());System.out.println(response.body());Fields and errors: Agents.
import java.net.URI;import java.net.http.HttpClient;import java.net.http.HttpRequest;import java.net.http.HttpResponse;
HttpClient client = HttpClient.newHttpClient();HttpRequest.BodyPublisher body = HttpRequest.BodyPublishers.noBody();HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://helpdesk.example.com/otobo/otai-api.pl/v1/agents")) .header("Authorization", "Bearer YOUR_TOKEN") .header("Accept", "application/json") .method("GET", body) .build();HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());System.out.println(response.body());Fields and errors: Customer users.
import java.net.URI;import java.net.http.HttpClient;import java.net.http.HttpRequest;import java.net.http.HttpResponse;
HttpClient client = HttpClient.newHttpClient();HttpRequest.BodyPublisher body = HttpRequest.BodyPublishers.noBody();HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://helpdesk.example.com/otobo/otai-api.pl/v1/customer-users?search=max@example.com")) .header("Authorization", "Bearer YOUR_TOKEN") .header("Accept", "application/json") .method("GET", body) .build();HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());System.out.println(response.body());No. The examples send HTTP with a bearer token. There is no package to publish or upgrade.
Call the OTOBO API from Java with java.net.http.HttpClient (Java 11 or newer). There is no library to deploy. The examples below are the whole client: a bearer token and JSON.
Sources
In the Authorization: Bearer header. The base URL ends with /otai-api.pl/v1.
Sources
Workflows and integrations
Web services, processes, and connections that fit your landscape.