Skip to content

OTOBO API authentication

Every call sends the token in the Authorization header. There is no UserLogin field and no session id in the JSON body.

Authorization: Bearer YOUR_TOKEN
Accept: application/json

Integration token. An administrator generates it under Admin → API. The package creates an agent user for that token. Use it for a service that runs without a person at the keyboard.

Personal token. An agent generates it under personal preferences, API tokens. The token uses that agent’s own queues and groups. Another person cannot read the secret after the screen closes.

Both kinds are stored as a hash. The plain token is shown once. Each token has an expiry. A revoked or expired token returns 401.

Edit the bound agent. Queue permissions, group rights, and FAQ categories are the API rights. The API screen lists the user and links to that agent. It does not keep a second checklist.

A call the user may not make returns 403. A missing ticket or FAQ item returns 404.

{
"error": {
"code": "token_expired",
"message": "This API token has expired."
}
}

Other codes: unauthorized, forbidden, not_found.

See tickets for the first write call, or the language pages for a full client.

import requests
response = requests.get(
"https://helpdesk.example.com/otobo/otai-api.pl/v1/agents",
headers={"Authorization": "Bearer YOUR_TOKEN"},
timeout=30,
)
response.raise_for_status()
print(response.json())
const response = await fetch(
"https://helpdesk.example.com/otobo/otai-api.pl/v1/agents",
{
method: "GET",
headers: {
Authorization: "Bearer YOUR_TOKEN",
Accept: "application/json",
},
},
);
if (!response.ok) throw new Error(await response.text());
console.log(await response.json());
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());
<?php
$ch = curl_init("https://helpdesk.example.com/otobo/otai-api.pl/v1/agents");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOUR_TOKEN",
"Accept: application/json",
"Content-Type: application/json",
],
CURLOPT_RETURNTRANSFER => true,
]);
$body = curl_exec($ch);
$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo $body;

Frequently asked questions

Why is the API token shown only once?

The package stores a hash, not the plain token. After you leave the generate screen, only a new token can be created.

Both kinds are stored as a hash. The plain token is shown once. Each token has an expiry. A revoked or expired token returns 401.

Sources

How do I change what a token can do?

Change the groups, roles, and queue permissions of the agent user bound to that token. Personal tokens use the agent who created them.

Sources

Workflows and integrations

Web services, processes, and connections that fit your landscape.