# OTOBO API FAQ

> Search and read FAQ articles on the OTOBO API. Results follow the token user's FAQ categories.

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

FAQ routes follow the FAQ categories granted to the token's user. A category that user cannot read is absent from the list.

| Action | Request |
| --- | --- |
| Search | `GET /faqs?query=vpn&limit=20` |
| One item | `GET /faqs/15` |

A hit includes `id`, `title`, `category`, `language`, and `state`. `GET /faqs/{id}` adds the body.

### Python

```python

response = requests.get(
    "https://helpdesk.example.com/otobo/otai-api.pl/v1/faqs?query=vpn&limit=20",
    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/faqs?query=vpn&limit=20", {
  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/faqs?query=vpn&limit=20"))
    .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/faqs?query=vpn&limit=20");
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 an FAQ article missing from search?

The token's user does not have that FAQ category, or the query does not match the title or body.

- [OTOBO API FAQ](https://otobo-docs.softoft.de/en/otobo-api/faq/)
- [OTOBO Admin Manual](https://doc.otobo.org/manual/admin/11.0/en/content/index.html)

### How do I read one FAQ article?

GET /faqs/{id} returns the article including its body when the user may read that category.

FAQ routes follow the FAQ categories granted to the token's user. A category that user cannot read is absent from the list.

- [OTOBO API FAQ](https://otobo-docs.softoft.de/en/otobo-api/faq/)
- [OTOBO Admin Manual](https://doc.otobo.org/manual/admin/11.0/en/content/index.html)
