Skip to content

Install the OTOBO API

The OTOBO API is the REST-API package. After install, Admin has API, API reference, and Webhooks. Calls go to otai-api.pl/v1 and carry a bearer token.

Source and the GPL-3.0 license: openticketai/otobo_znuny_rest_api. Tokens and the admin route list are in the REST API guide. After the token, continue with authentication.

The OTOBO manifest is REST-API-OTOBO.sopm. The build writes REST-API-<version>.opm. The version is the one in the manifest. Install that file.

From the cloned repository directory, on the OTOBO host. otobo-web-1 is the web container of a Docker Compose install. Replace the name when your container is named differently.

Terminal window
docker cp . otobo-web-1:/tmp/otai-opm
docker exec otobo-web-1 /opt/otobo/bin/otobo.Console.pl \
Dev::Package::Build --module-directory /tmp/otai-opm \
/tmp/otai-opm/REST-API-OTOBO.sopm /tmp/otai-out

The file is then under /tmp/otai-out/ inside the container. Copy it out when you want to upload it in Package Manager.

  1. Sign in as an administrator.
  2. Open Admin → Package Manager.
  3. Upload REST-API-<version>.opm as a local package and install it.

Package Manager checks the framework. If this OTOBO version is not 11.0.x or 11.1.x, install stops.

On a host that does not use that Docker name, the console is /opt/otobo/bin/otobo.Console.pl. The path is the .opm from the build.

Terminal window
/opt/otobo/bin/otobo.Console.pl Admin::Package::Install /path/REST-API-VERSION.opm

Replace REST-API-VERSION.opm with the file name Dev::Package::Build wrote.

Install creates the user otai-webservice when that login is missing. The account is in the ai-agent group, not in users, and cannot sign in to the agent interface. The password is random and is not shown. You do not supply a password before install.

Admin → API removes the users group again if someone adds it later. Grant FAQ categories to ai-agent when that user should read FAQ.

An upgrade removes the old Generic Interface webservices OpenTicketAI, OpenTicketAI-RuntimeEvents, and OpenTicketAI-SearchEvents when they are still installed. The API itself is not a webservice in that builder.

  1. Open Admin → API.
  2. Switch the API on. The switch is on after install.
  3. Generate a token and copy it immediately. The screen does not show it again.
  4. The package binds that token to a system user. What a call may do is that person’s groups, roles, and queues. Change those on the user. The two token kinds are on authentication.

Then send Authorization: Bearer and Accept: application/json.

Open Admin → API reference, or the same page in the browser:

https://helpdesk.example.com/otobo/otai-api.pl/v1/docs

helpdesk.example.com is your helpdesk host. A first call:

Terminal window
curl -sS \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Accept: application/json" \
"https://helpdesk.example.com/otobo/otai-api.pl/v1/tickets?state=new&limit=1"

200 and JSON mean the package, the switch, and the token agree. 401 means a wrong, revoked, or expired token. One language per page: Python, TypeScript, Java, and PHP.

These variables are optional. SysConfig is the admin fallback when they are empty.

Variable Default Purpose
OTAI_TICKETSYSTEM_USERNAME otai-webservice API user login
OTAI_WEBHOOK_URL empty Where ticket and FAQ events are sent
OTAI_API_TOKEN empty Webhook send token, if set before start

Frequently asked questions

How do I install the OTOBO API?

Build the package file from the manifest REST-API-OTOBO.sopm. The result is named REST-API-, the version from the manifest, and .opm. Upload that file under Admin, Package Manager, or install it with otobo.Console.pl Admin::Package::Install.

Install creates the user otai-webservice when that login is missing. The account is in the ai-agent group, not in users, and cannot sign in to the agent interface. You do not type a password. Then open Admin, API, switch the API on, and copy the token. The screen shows it once.

Sources

Which OTOBO version does the REST-API package support?

The manifest REST-API-OTOBO.sopm lists frameworks 11.0.x and 11.1.x. Install that manifest on OTOBO. The second manifest in the same repository is for a different ticket system and does not belong on this instance.

After install, open Admin, API reference, or otai-api.pl/v1/docs on the helpdesk. A call with Authorization Bearer and Accept application/json returns tickets once the token is valid.

Sources

Workflows and integrations

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