# OTOBO API queues, states, and dynamic fields

> List queues, states, types, services, priorities, and dynamic fields on the OTOBO API.

- HTML: https://otobo-docs.softoft.de/en/otobo-api/catalogue/
- Markdown: https://otobo-docs.softoft.de/en/otobo-api/catalogue.md

Catalogue routes are read-only lists. Use them to fill ticket create and search with names the system actually has. Each list is filtered by the token's user, the same way the agent interface hides queues that user cannot see.

| List | Request |
| --- | --- |
| Queues | `GET /queues` |
| States | `GET /states` |
| Types | `GET /types` |
| Services | `GET /services` |
| Priorities | `GET /priorities` |
| Dynamic fields | `GET /dynamic-fields` |
| Values of one dynamic field | `GET /dynamic-fields/Department/values` |

An item has `id`, `name`, and `valid`. Dynamic field items also have `fieldType`.

### Python

```python

response = requests.get(
    "https://helpdesk.example.com/otobo/otai-api.pl/v1/queues",
    headers={"Authorization": "Bearer YOUR_TOKEN"},
    timeout=30,
)
response.raise_for_status()
print(response.json())
```

### TypeScript

```typescript
const response = await fetch("https://helpdesk.example.com/otobo/otai-api.pl/v1/queues", {
  method: "GET",
  headers: {
    Authorization: "Bearer YOUR_TOKEN",
    Accept: "application/json",
  },
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.json());
```

### Java

```java

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 response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```

### PHP

```php
<?php
$ch = curl_init("https://helpdesk.example.com/otobo/otai-api.pl/v1/queues");
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;
```

Longer examples, one page per language:

- [Python](https://otobo-docs.softoft.de/en/otobo-api/python/)
- [TypeScript](https://otobo-docs.softoft.de/en/otobo-api/typescript/)
- [Java](https://otobo-docs.softoft.de/en/otobo-api/java/)
- [PHP](https://otobo-docs.softoft.de/en/otobo-api/php/)

## Frequently asked questions

### Why is a queue missing from GET /queues?

The token's user has no permission on that queue, or the queue is not valid.

- [OTOBO API queues, states, and dynamic fields](https://otobo-docs.softoft.de/en/otobo-api/catalogue/)
- [OTOBO Admin Manual](https://doc.otobo.org/manual/admin/11.0/en/content/index.html)

### How do I read values of a dynamic field?

GET /dynamic-fields/{name}/values returns the selectable values for that field.

- [OTOBO API queues, states, and dynamic fields](https://otobo-docs.softoft.de/en/otobo-api/catalogue/)
- [OTOBO Admin Manual](https://doc.otobo.org/manual/admin/11.0/en/content/index.html)
