---
url: https://next.zammad.org/it/reference/rest-api/notification.md
---

# Online notification

::: info
La disponibilità della notifica dipende fortemente dai permessi dell'utente e dalle notifiche scelte.
:::

## Elenca

Permesso richiesto: `any`

Richiesta `GET` inviata: `/api/v1/online_notifications?expand=true`

::: tip
Usa la richiesta expand per conoscere gli oggetti interessati. Altrimenti dovrai
scoprire cosa.
:::

::: details

```json
// HTTP-Code 200 OK

[
  {
    "id": 4,
    "o_id": 6,
    "object_lookup_id": 2,
    "type_lookup_id": 1,
    "user_id": 3,
    "seen": false,
    "updated_by_id": 8,
    "created_by_id": 8,
    "created_at": "2021-11-09T13:15:42.628Z",
    "updated_at": "2021-11-09T13:15:42.637Z",
    "user": "lauren@fastlane.inc",
    "object": "Ticket",
    "type": "create",
    "created_by": "ethan@fastlane.inc",
    "updated_by": "ethan@fastlane.inc"
  },
  {
    "id": 3,
    "o_id": 8,
    "object_lookup_id": 2,
    "type_lookup_id": 2,
    "user_id": 3,
    "seen": false,
    "updated_by_id": 4,
    "created_by_id": 4,
    "created_at": "2021-11-09T13:10:42.628Z",
    "updated_at": "2021-11-09T13:15:42.635Z",
    "user": "lauren@fastlane.inc",
    "object": "Ticket",
    "type": "update",
    "created_by": "hannah@fastlane.inc",
    "updated_by": "hannah@fastlane.inc"
  },
  {
    "id": 2,
    "o_id": 3,
    "object_lookup_id": 2,
    "type_lookup_id": 1,
    "user_id": 3,
    "seen": true,
    "updated_by_id": 6,
    "created_by_id": 6,
    "created_at": "2021-11-09T12:45:42.625Z",
    "updated_at": "2021-11-09T13:15:42.632Z",
    "user": "lauren@fastlane.inc",
    "object": "Ticket",
    "type": "create",
    "created_by": "anna@example.com",
    "updated_by": "anna@example.com"
  },
  {
    "id": 1,
    "o_id": 2,
    "object_lookup_id": 2,
    "type_lookup_id": 1,
    "user_id": 3,
    "seen": true,
    "updated_by_id": 5,
    "created_by_id": 5,
    "created_at": "2021-11-09T11:45:42.624Z",
    "updated_at": "2021-11-09T13:15:42.629Z",
    "user": "lauren@fastlane.inc",
    "object": "Ticket",
    "type": "create",
    "created_by": "emily@fastlane.inc",
    "updated_by": "emily@fastlane.inc"
  }
]

```

:::

## Mostra

Permesso richiesto: `any`

Richiesta `GET` inviata: `/api/v1/online_notifications/{id}`

::: details

```json
// HTTP-Code 200 OK

{
  "id": 4,
  "o_id": 6,
  "object_lookup_id": 2,
  "type_lookup_id": 1,
  "user_id": 3,
  "seen": false,
  "updated_by_id": 8,
  "created_by_id": 8,
  "created_at": "2021-11-09T13:15:42.628Z",
  "updated_at": "2021-11-09T13:15:42.637Z"
}

```

:::

## Aggiornamento

Permesso richiesto: `any`

Richiesta `PUT` inviata: `/api/v1/online_notifications/{id}`

:::: details

::: tabs key:reqres

\=== Richiesta

```json
{
  "seen": true
}

```

\=== Risposta

```json
// HTTP-Code 200 OK

{
  "id": 4,
  "seen": true,
  "updated_by_id": 3,
  "o_id": 6,
  "object_lookup_id": 2,
  "type_lookup_id": 1,
  "user_id": 3,
  "created_by_id": 8,
  "created_at": "2021-11-09T13:15:42.628Z",
  "updated_at": "2021-11-09T13:25:00.004Z"
}

```

:::
::::

## Elimina

Permesso richiesto: `any`

Richiesta `DELETE` inviata: `/api/v1/online_notifications/{id}`

::: details

```json
// HTTP-Code 200 OK

{}

```

:::

## Mark all as read

Permesso richiesto: `any`

Richiesta `POST` inviata: `/api/v1/online_notifications/mark_all_as_read`

::: details

```json
// HTTP-Code 200 OK

{}

```

:::

## Clear all

Permesso richiesto: `any`

`DELETE`-Request sent: `/api/v1/online_notifications/clear_all`

::: details

```json
// HTTP-Code 200 OK

{}

```

:::
