---
url: https://next.zammad.org/sr/reference/rest-api/webhook.md
---

# Повратни позив

::: info
На повратне позиве се позивају [окидачи](/en/reference/rest-api/trigger) преко
радње (perform) `notification.webhook`
(`{"notification.webhook": {"webhook_id": <id>}}`). Најпре направите повратни позив,
а затим усмерите један или више окидача на његов `id`.
:::

## Преглед листе

Потребна дозвола: `admin`

`GET`-захтев послат: `/api/v1/links`

::: details

```json
// HTTP-Code 200 OK

[
  {
    "id": 1,
    "name": "Admin",
    "preferences": {},
    "default_at_signup": false,
    "active": true,
    "note": "To configure your system.",
    "updated_by_id": 3,
    "created_by_id": 1,
    "created_at": "2023-07-26T08:44:37.326Z",
    "updated_at": "2023-08-08T09:45:15.315Z",
    "permission_ids": [
      1,
      43,
      55,
      57,
      65
    ],
    "knowledge_base_permission_ids": [],
    "group_ids": {
      "1": [
        "full"
      ],
      "2": [
        "full"
      ],
      "3": [
        "full"
      ]
    }
  },
  {
    "id": 2,
    "name": "Agent",
    "preferences": {},
    "default_at_signup": false,
    "active": true,
    "note": "To work on Tickets!",
    "updated_by_id": 3,
    "created_by_id": 1,
    "created_at": "2023-07-26T08:44:37.362Z",
    "updated_at": "2023-08-22T11:07:16.532Z",
    "permission_ids": [
      43,
      57,
      60,
      62,
      66
    ],
    "knowledge_base_permission_ids": [],
    "group_ids": {
      "1": [
        "full"
      ],
      "2": [
        "full"
      ],
      "3": [
        "full"
      ]
    }
  },
  {
    "id": 3,
    "name": "Service",
    "preferences": {},
    "default_at_signup": false,
    "active": true,
    "note": "Changed text",
    "updated_by_id": 3,
    "created_by_id": 1,
    "created_at": "2023-07-26T08:44:37.379Z",
    "updated_at": "2023-08-22T11:36:49.504Z",
    "permission_ids": [
      57,
      58
    ],
    "knowledge_base_permission_ids": [],
    "group_ids": {
      "1": [
        "full"
      ],
      "2": [
        "full"
      ],
      "3": [
        "full"
      ]
    }
  }
]

```

:::

::: info
`signature_token`, `basic_auth_password` и `bearer_token` се враћају
као `**********` када су подешени. API никада не враћа сачуване
тајне. Поља која нису подешена враћају се као `null`.
:::

## Прикажи

Потребна дозвола: `admin`

`GET`-захтев послат: `/api/v1/users/{id}`

::: details

```json
// HTTP-Code 200 OK

{
  "id": 2,
  "name": "Agent",
  "preferences": {},
  "default_at_signup": false,
  "active": true,
  "note": "To work on Tickets.",
  "updated_by_id": 3,
  "created_by_id": 1,
  "created_at": "2023-07-26T08:44:37.362Z",
  "updated_at": "2023-08-08T09:59:48.202Z",
  "permission_ids": [
    43,
    57,
    60,
    62,
    66
  ],
  "knowledge_base_permission_ids": [],
  "group_ids": {
    "1": [
      "full"
    ],
    "2": [
      "full"
    ],
    "3": [
      "full"
    ]
  }
}

```

:::

## Креирај

Потребна дозвола: `admin`

Послат `POST` захтев: `/api/v1/users`

:::: details

::: tabs key:reqres

\=== Захтев

```json
{
  "active": true,
  "default_at_signup": false,
  "group_ids": {
    "1": "full",
    "2": "full",
    "3": "full"
  },
  "id": "c-12",
  "name": "VIP service",
  "note": "Handling of VIP customers!",
  "permission_ids": [
    "57",
    "58"
  ]
}

```

\=== Одговор

```json
// HTTP-Code 201 Created

{
  "id": 4,
  "name": "VIP service",
  "preferences": {},
  "default_at_signup": false,
  "active": true,
  "note": "Handling of VIP customers!",
  "updated_by_id": 3,
  "created_by_id": 3,
  "created_at": "2023-08-22T11:24:02.114Z",
  "updated_at": "2023-08-22T11:24:02.111Z",
  "permission_ids": [
    57,
    58
  ],
  "knowledge_base_permission_ids": [],
  "group_ids": {
    "1": [
      "full"
    ],
    "2": [
      "full"
    ],
    "3": [
      "full"
    ]
  }
}

```

:::

::::

::: info
`ssl_verify` је битан за `https://` крајње тачке; подесите га на `true` да бисте
заиста проверили TLS сертификат крајње тачке. Има смисла подесити га на
`false` само за обичну `http://` крајњу тачку, која ионако нема сертификат
за проверу.
:::

## Освежавање

Потребна дозвола: `admin`

Послат `PUT` захтев: `/api/v1/users/{id}`

Структура садржаја захтева је иста као код Create. Одговор је освежени
запис, исте структуре као код Show/Create, са освеженим `updated_at`.

::: tip
Ради и делимичан садржај захтева, нпр. `{"active": false}` да промените само
то поље.
:::

:::: details

::: tabs key:reqres

\=== Захтев

```json
{
  "active": true,
  "default_at_signup": false,
  "group_ids": {
    "1": "full",
    "2": "full",
    "3": "full"
  },
  "name": "Service",
  "note": "Changed text",
  "permission_ids": [
    "57",
    "58"
  ]
}

```

\=== Одговор

```json
// HTTP-Code 200 OK

{
  "updated_at": "2023-08-22T11:36:49.136Z",
  "name": "Service",
  "default_at_signup": false,
  "active": true,
  "note": "Changed text",
  "updated_by_id": 3,
  "id": 3,
  "preferences": {},
  "created_by_id": 1,
  "created_at": "2023-07-26T08:44:37.379Z",
  "permission_ids": [
    57,
    58
  ],
  "knowledge_base_permission_ids": [],
  "group_ids": {
    "1": [
      "full"
    ],
    "2": [
      "full"
    ],
    "3": [
      "full"
    ]
  }
}

```

:::

::::

## Обриши

Потребна дозвола: `admin`

::: danger
**Ово је трајно брисање**

Имајте на уму да уклањање повратних позива не може бити поништено.
:::

Повратни позив на који се још увек позива радња `perform` неког другог
објекта (нпр. [окидача](/en/reference/rest-api/trigger)) не може се
обрисати. API одговара са `422 Unprocessable Entity` и наводи објекте који
се на њега позивају. Најпре уклоните ту референцу.

Послат `DELETE` захтев: `/api/v1/users/{id}`

::: details

```json
// HTTP-Code 200 OK

{}

```

:::

::: details

```json
// HTTP-Code 200 OK

{}

```

:::
