# InfoboardDepartmentSettings

`InfoboardDepartmentSettings` store settings for a [Department](https://docs.api.intratool.de/api-reference/departments) in the context of the Infoboard. For example the default [InfoboardChannel](https://docs.api.intratool.de/api-reference/infoboard/infoboard-channels) ID.

## Alias

`infoboardDepartmentSettings`

### Relations

| Key          | Relation                                                              | Type       | Relation Field(s) |
| ------------ | --------------------------------------------------------------------- | ---------- | ----------------- |
| `user`       | [User](https://docs.api.intratool.de/api-reference/users)             | Belongs to | `user_id`         |
| `department` | [Department](https://docs.api.intratool.de/api-reference/departments) | Belongs to | `department_id`   |

## Show

Show the current user's `InfoboardDepartmentSettings`.

**Definition**

<mark style="color:green;">`GET`</mark> `/api/infoboard/department-settings/current`

**Example Request**

{% tabs %}
{% tab title="PHP" %}

```php
$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('GET', '/api/infoboard/department-settings/current', [
    'headers' => ['Authorization' => "Bearer {accessToken}"]
]);
```

{% endtab %}
{% endtabs %}

**Example Response**

```json
{
  "id": 1,
  "user_id": 1,
  "department_id": 1,
  "settings": {
    "default_channel_id": 1
  },
  "created_at": "2025-03-17 12:00:00",
  "updated_at": "2025-03-17 12:00:00",
  "deleted_at": null
}
```

## \[Adm.] List

Get a list of all `InfoboardDepartmentSettings`.

**Definition**

<mark style="color:green;">`GET`</mark> `/api/administration/infoboard/department-settings`

**Example Request**

{% tabs %}
{% tab title="PHP" %}

```php
$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('GET', '/api/administration/infoboard/department-settings', [
    'headers' => ['Authorization' => "Bearer {accessToken}"]
]);
```

{% endtab %}
{% endtabs %}

**Example Response Body**

```json
[
  {
    "id": 1,
    "user_id": 1,
    "department_id": 1,
    "settings": {
      "default_channel_id": 1
    },
    "created_at": "2025-03-17 12:00:00",
    "updated_at": "2025-03-17 12:00:00",
    "deleted_at": null
  },
  {
    "id": 2,
    "user_id": 1,
    "department_id": 2,
    "settings": {
      "default_channel_id": 2
    },
    "created_at": "2025-03-17 13:00:00",
    "updated_at": "2025-03-17 13:00:00",
    "deleted_at": null
  }
]
```

## \[Adm.] Show

Show `InfoboardDepartmentSettings` by `department_id`.

**Definition**

<mark style="color:green;">`GET`</mark> `/api/administration/infoboard/department-settings/{department_id}`

**Example Request**

{% tabs %}
{% tab title="PHP" %}

```php
$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('GET', '/api/administration/infoboard/department-settings/1', [
    'headers' => ['Authorization' => "Bearer {accessToken}"]
]);
```

{% endtab %}
{% endtabs %}

**Example Response Body**

```json
{
  "id": 1,
  "user_id": 1,
  "department_id": 1,
  "settings": {
    "default_channel_id": 1
  },
  "created_at": "2025-03-17 12:00:00",
  "updated_at": "2025-03-17 12:00:00",
  "deleted_at": null
}
```

## \[Adm.] Create or update

Create new `InfoboardDepartmentSettings`. When `InfoboardDepartmentSettings` with the given data already exits, the `updated_at` timestamp will be updated.

**Definition**

<mark style="color:yellow;">`POST`</mark> `/api/administration/infoboard/department-settings/{department_id}`

**Request Keys**

<table><thead><tr><th>Key</th><th width="139">Type</th><th>Default</th><th>Description</th></tr></thead><tbody><tr><td><code>department_id</code>*</td><td>integer</td><td>-</td><td>The ID of the <a href="../departments">Department</a> that the settings relate to.</td></tr><tr><td><code>settings</code>*</td><td>array</td><td>-</td><td>The array with the infoboard settings.</td></tr><tr><td><code>settings.default_channel_id</code>*</td><td>integer</td><td>-</td><td>The ID of the default <a href="infoboard-channels">InfoboardChannel</a>.</td></tr></tbody></table>

Keys with `*` are required.

**Example Request**

{% tabs %}
{% tab title="PHP" %}

```php
$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('POST', '/api/administration/infoboard/department-settings/1', [
    'headers' => ['Authorization' => "Bearer {accessToken}"],
    'json' => [
        'department_id' => 1,
        'settings': [
            'default_channel_id': 1
        ]
    ]
]);
```

{% endtab %}
{% endtabs %}

**Example Response Body**

```json
{
  "id": 1,
  "user_id": 1,
  "department_id": 1,
  "settings": {
    "default_channel_id": 1
  },
  "created_at": "2025-03-17 12:00:00",
  "updated_at": "2025-03-17 12:00:00",
  "deleted_at": null
}
```

## \[Adm.] Delete

Delete existing `InfoboardDepartmentSettings` by `department_id`.

**Definition**

<mark style="color:red;">`DELETE`</mark> `/api/administration//infoboard/department-settings/{department_id}`

**Example Request**

{% tabs %}
{% tab title="PHP" %}

```php
$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('DELETE', '/api/administration//infoboard/department-settings/3', [
    'headers' => ['Authorization' => "Bearer {accessToken}"]
]);
```

{% endtab %}
{% endtabs %}

**Example Response Body**

```json
{
  "status": "success",
  "data": null
}
```
