# OTOBO API customers

> Look up customer companies and customer users on the OTOBO API before you create a ticket.

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

Customer companies and customer users are two lists.

| List | Request |
| --- | --- |
| Customer companies | `GET /customers?name=Example` |
| Customer users | `GET /customer-users?search=max@example.com` |

A customer company item has `id` and `name`. A customer user item has `login`, `email`, `firstName`, `lastName`, and `customerId`.

Use `customerUser` on [ticket create](https://otobo-docs.softoft.de/en/otobo-api/tickets/) with the customer user login.

### Python

```python

response = requests.get(
    "https://helpdesk.example.com/otobo/otai-api.pl/v1/customer-users?search=max@example.com",
    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/customer-users?search=max@example.com", {
  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/customer-users?search=max@example.com"))
    .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/customer-users?search=max@example.com");
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

### What is the difference between customers and customer users?

Customers are companies. Customer users are the people who log in and own tickets. Ticket create takes a customer user login.

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

### How do I find a customer user by email?

GET /customer-users?search= with the email or part of the login.

A customer company item has id and name. A customer user item has login, email, firstName, lastName, and customerId.

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