# Webhooks

Webhook é o serviço de notificação sistêmica, que permite a integração assíncrona entre sistemas, notificando o outro sistema através de um [gatilho](#data).

Ao configurar um webhook você poderá utilizar alguns modelos de [autenticação](#authorization), que garantem maior confiança na fonte que está se comunicando com o seu endpoint.

{% hint style="warning" %}
O webhook  possui uma função de Retry, a qual irá realizar uma nova tentativa a cada 5 segundos por 3 dias (quando a requisição será abandonada).\
Durante o período, todas as requisições deste webhook que falharem ficarão em fila, sendo apenas uma tentativa (desta configuração de webhook) a cada 5 segundo.\
Uma vez que o serviço receba o Ok de seu endpoint, as requisições serão liberadas em sequência, ou seja, uma de cada vez.
{% endhint %}

## Create webhook

<mark style="color:green;">`POST`</mark> `https://api.acessorh.com.br/v1/integrations/webhook`

Cria uma integração via webhook que é disparado para a api cadastrada quando determinados eventos relacionados a posição ocorrerem.

#### Headers

| Name                                            | Type   | Description                                                    |
| ----------------------------------------------- | ------ | -------------------------------------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Token de acesso adquirido pela plataforma Identity *(bearer)*. |

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

```
{
    "account": "2d9174c4-06b7-4956-a5dc-8824d8a2f49e",
    "authorization": {
        "kind": "secret"
    },
    "data": {
        "url": "https://api.teste.com.br/callback",
        "events": [
            "position-created",
            "position-archived",
            "position-completed"
        ]
    },
    "uid": "a7c001fe-50bb-41cd-a910-da27e538726f",
    "unit": "82930d53-e99a-4927-b31e-4fdc7090395d"
}
```

{% endtab %}
{% endtabs %}

* [Descrição do body JSON da request](#descricao-do-body-json-da-request)
* [Exemplo de requisição](#exemplo-de-requisicao)
* [Calcular assinatura do payload](#calcular-assinatura-do-payload)
* [Exemplo de callback](#exemplo-de-callback)

### Descrição do body JSON da request

| Chave                                                         | Tipo   | Descrição                                    |
| ------------------------------------------------------------- | ------ | -------------------------------------------- |
| <p><strong>account</strong></p><p><em>required</em></p>       | string | UID da empresa desejada.                     |
| <p><strong>unit</strong></p><p><em>optional</em></p>          | string | UID da filial desejada.                      |
| <p><strong>authorization</strong></p><p><em>optional</em></p> | object | Método de autenticação a ser realizado.      |
| <p><strong>data</strong></p><p><em>required</em></p>          | object | Configuração do callback que será realizado. |

{% hint style="info" %}
Caso o parâmetro `unit` não seja passado, o callback será executado para todas as filiais da empresa.
{% endhint %}

#### Authorization

{% hint style="info" %}
Para proteger as requisições de callback do webhook, é possível selecionar três opções: [**basic** ](#authorization-data-basic), [**secret**](#authorization-data-secret) ou [**apiKey**](#apikey-data-apikey). Cada uma das opções requer configurações diferentes as quais você pode encontrar mais abaixo.
{% endhint %}

| Chave                                                | Tipo                                  | Descrição                                       |
| ---------------------------------------------------- | ------------------------------------- | ----------------------------------------------- |
| <p><strong>kind</strong></p><p><em>required</em></p> | string ([*options*](#opcoes-de-kind)) | Tipo da autenticação que será realizada.        |
| <p><strong>data</strong></p><p><em>required</em></p> | object                                | Configuração do tipo de autenticação escolhido. |

#### Opções de kind

```
basic, secret, apiKey
```

#### Authorization: data (basic)

{% hint style="info" %}
Na opção ***basic***, o callback será executado com um header **Authorization: basic \<credenciais>**. As credenciais serão o usuário e senha concatenados por dois pontos (**:**) e codificados em base64.
{% endhint %}

| Chave                                                    | Tipo   | Descrição         |
| -------------------------------------------------------- | ------ | ----------------- |
| <p><strong>username</strong></p><p><em>required</em></p> | string | Nome do usuário.  |
| <p><strong>password</strong></p><p><em>required</em></p> | string | Senha do usuário. |

#### Authorization: data (secret)

{% hint style="info" %}
Na opção ***secret***, a intenção é que o recebedor consiga se certificar de que o callback recebido foi realizado pelo Acesso RH. Por isso, o callback será executado com um header **Acesso-Signature: \<assinatura>**, sendo a assinatura um hash criado para cada payload. O Acesso RH utiliza um **HMAC** em conjunto com uma chave **sha256** e o **secret** configurado para calcular e gerar esta assinatura, codificando-a em base64. O mesmo procedimento deve ser realizado na aplicação que receberá esta requisição, comparando a chave gerada e a presente no header. [**Aqui** ](#calcular-assinatura-do-payload)alguns exemplos de como criar esta verificação.
{% endhint %}

| Chave                                                  | Tipo   | Descrição                        |
| ------------------------------------------------------ | ------ | -------------------------------- |
| <p><strong>secret</strong></p><p><em>required</em></p> | string | Chave que assinará a requisição. |

#### ApiKey: data (apiKey)

{% hint style="info" %}
Na opção **apiKey**, o callback será executado com um header \
**Authorization: \<prefix> \<key>**. \
Onde o prefix é um campo opcional e key a chave da apiKey.\
Prefix e key são separados por um espaço em branco.
{% endhint %}

| Chave  | Tipo   | Descrição                                               |
| ------ | ------ | ------------------------------------------------------- |
| key    | string | Chave da apiKey                                         |
| prefix | string | Prefixo opcional que pode acompanhar o valor da apiKey. |

#### Data

Neste ponto serão cadastrados o gatilho ou "trigger" do webhook (motivo pelo qual a chamada do webhook acontecerá), e a URL a qual receberá este aviso.

| Chave                                                  | Tipo                                   | Descrição                                                                                |
| ------------------------------------------------------ | -------------------------------------- | ---------------------------------------------------------------------------------------- |
| <p><strong>url</strong></p><p><em>required</em></p>    | string                                 | <p>URL para a execução do callback. Aceito apenas</p><p>endereços HTTPS.</p>             |
| <p><strong>events</strong></p><p><em>required</em></p> | array\[[string](#eventos-monitorados)] | <p>Lista de eventos que este webhook irá acompanhar </p><p>para executar o callback.</p> |

#### Eventos monitorados

{% hint style="info" %}
Os eventos que poderão ser acompanhados pelos webhooks são:

* **position-created** (uma posição foi criada na empresa/filial configurada)
* **position-applied** (um candidato aplicou em uma posição na empresa/filial configurada)
* **position-completed** (uma posição foi concluída pela análise do Acesso RH ou manualmente pelo DP da empresa/filial configurada)
* **position-archived** (uma posição foi arquivada pelo DP da empresa/filial configurada)
* **position-declined** (uma posição que foi declinada da vaga)
  {% endhint %}

### Exemplos de requisição <a href="#requisicoeswebhook" id="requisicoeswebhook"></a>

{% tabs %}
{% tab title="secret" %}
{% hint style="info" %}
[Mais informações](#authorization-data-secret)
{% endhint %}

```json
{
  	"account": "2d9174c4-06b7-4956-a5dc-8824d8a2f49e",
  	"unit": "82930d53-e99a-4927-b31e-4fdc7090395d",
  	"authorization": {
  		"kind": "secret",
  		"data": {
  			"secret": "tme0dQq1CIDm4PYsfK!d"
  		}
  	},
  	"data": {
  		"url": "https://api.teste.com.br/callback",
  		"events": [
  			"position-created",
  			"position-archived",
  			"position-completed"
  		]
  	}
}
```

{% endtab %}

{% tab title="basic" %}
{% hint style="info" %}
[Mais informações](#authorization-data-basic)
{% endhint %}

```json
{
	"account": "2d9174c4-06b7-4956-a5dc-8824d8a2f49e",
        "unit": "82930d53-e99a-4927-b31e-4fdc7090395d",
	"authorization": {
		"kind": "basic",
		"data": {
                       "username": "teste",
		       "password": "1234"
		}
	},
	"data": {
		"url": "https://api.teste.com.br/callback",
		"events": [
			"position-created",
			"position-archived"
		]
	}
}
```

{% endtab %}

{% tab title="apiKey" %}
{% hint style="info" %}
[Mais informações](#apikey-data-apikey)
{% endhint %}

```json
{
	"account": "2d9174c4-06b7-4956-a5dc-8824d8a2f49e",
        "unit": "82930d53-e99a-4927-b31e-4fdc7090395d",
	"authorization": {
		"kind": "apiKey",
		"data": {
                       "key": "password123",
		       "prefix": "X-Api-Key" // opcional
		}
	},
	"data": {
		"url": "https://api.teste.com.br/callback",
		"events": [
			"position-created",
			"position-archived"
		]
	}
}
```

{% endtab %}

{% tab title="Put webhook" %}
{% hint style="info" %}
[Mais informações](#update-webhook)
{% endhint %}

```json
{
	"id": "b712a527-efec-4e02-83d5-95cbd7c269f9",
	"account": "2d9174c4-06b7-4956-a5dc-8824d8a2f49e",
        "unit": "82930d53-e99a-4927-b31e-4fdc7090395d",
	"authorization": {
		"kind": "apiKey",
		"data": {
                       "key": "password123",
		       "prefix": "X-Api-Key"
		}
	},
	"data": {
		"url": "https://api.teste.com.br/callback",
		"events": [
			"position-created",
			"position-archived"
		]
	}
}
```

{% endtab %}
{% endtabs %}

### Calcular assinatura do payload

Abaixo, seguem alguns exemplos de códigos para calcular a assinatura do payload quando a opção secret for configurada nos webhooks:

* [**C#**](#c)
* [**Go**](#go)
* [**Java**](#java)
* [**Python 3**](#python-3)

#### C\#

```csharp
using System.Security.Cryptography;

private static byte[] HashHMAC(byte[] msg, String secret)
{
    var key = Encoding.ASCII.GetBytes(secret);
    var hash = new HMACSHA256(key);
    return Convert.ToBase64String(hash.ComputeHash(msg));
}
```

#### Go

```go
import (
	"crypto/hmac"
	"crypto/sha256"
	"encoding/base64"
)

func HashHMAC(msg []byte, secret string) string {
	key := []byte(secret)	
	h := hmac.New(sha256.New, key)
	h.Write(msg)
	return base64.StdEncoding.EncodeToString(h.Sum(nil))
}
```

#### Java

```java
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import org.apache.commons.codec.binary.Base64;

public static byte[] HashHMAC(byte[] msg, String secret) {
    Mac sha256_HMAC = Mac.getInstance("HmacSHA256");
    SecretKeySpec secret_key = new SecretKeySpec(secret.getBytes(), "HmacSHA256");
    sha256_HMAC.init(secret_key);
    
    String hash = Base64.encodeBase64String(sha256_HMAC.doFinal(msg));
}
```

#### Python 3

```python
import hashlib
import hmac
import base64

def hashHMAC(msg, secret):
    key = bytes(secret, 'utf-8')

    signature = base64.b64encode(hmac.new(key, message, digestmod=hashlib.sha256).digest())
    return signature
```

### Exemplo de callback

#### Headers

<table data-header-hidden><thead><tr><th width="179.03403414884974">Header</th><th>Descrição</th></tr></thead><tbody><tr><td>Header</td><td>Descrição</td></tr><tr><td><strong>Acesso-Delivery-Id</strong></td><td>UID do callback</td></tr><tr><td><strong>Acesso-Signature</strong></td><td><p>Caso a opção <strong>Secret</strong> tenha sido selecionada em </p><p><strong>Authorization</strong>, armazena a assinatura do body da requisição</p></td></tr><tr><td><strong>Authorization</strong></td><td><p>Caso a opção <strong>Basic</strong> ou <strong>ApiKey</strong> tenha sido selecionada em <strong>Authorization.</strong><br>Para <strong>Basic</strong> esse header armazena o usuário e senha concatenados e</p><p>codificados em base64, enquanto para <strong>ApiKey</strong> será a própria key pura com  o prefixo caso tenha sido cadastrado.</p></td></tr><tr><td><strong>Content-Type</strong></td><td>Identifica o tipo do body da requisição</td></tr></tbody></table>

#### Body

```
{
    "integration": "0a22e148-6610-4d38-bcb7-20bbc465d43c",
    "position": "302fc619-2054-448c-a9f8-d1093fcaddf2",
    "position-number": "ABC123",
    "unit": "8a240932-7c99-40da-aeb8-37a89308c642",
    "event": "position-archived"
}
```

## Update webhook

<mark style="color:orange;">`PUT`</mark> `https://api.acessorh.com.br/v1/integrations/webhook`

#### Headers

| Name          | Type   | Description                                                    |
| ------------- | ------ | -------------------------------------------------------------- |
| Authorization | string | Token de acesso adquirido pela plataforma Identity *(bearer)*. |

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

```
{
    "account": "2d9174c4-06b7-4956-a5dc-8824d8a2f49e",
    "unit": "82930d53-e99a-4927-b31e-4fdc7090395d",
    "authorization": {
        "kind": "basic"
    },
    "data": {
        "url": "https://api.teste.com.br/callback",
        "events": [
            "position-created",
            "position-archived"
        ]
    },
    "uid": "0a22e148-6610-4d38-bcb7-20bbc465d43c"
}
```

{% endtab %}
{% endtabs %}

* [Descrição do body JSON da request](#descricao-do-body-json-da-request-1)

### Descrição do body JSON da request

| Chave                                                                                      | Tipo   | Descrição                                       |
| ------------------------------------------------------------------------------------------ | ------ | ----------------------------------------------- |
| <p><strong>id</strong></p><p><em>required</em></p>                                         | string | UID do webhook a ser atualizado.                |
| <p><strong>account</strong></p><p><em>required</em></p>                                    | string | UID da empresa do webhook a ser atualizado.     |
| <p><strong>unit</strong></p><p><em>optional</em></p>                                       | string | UID da filial a ser atualizado no webhook.      |
| <p><a href="#authorization"><strong>authorization</strong></a></p><p><em>optional</em></p> | object | Método de autenticação a ser atualizado.        |
| <p><a href="#data"><strong>data</strong></a></p><p><em>optional</em></p>                   | object | Configurações do webhook que serão atualizados. |

{% hint style="info" %}
Para atualização, pelo menos um dos campos `unit` , `authorization` e`data` deverão ser preenchidos.

Qualquer um dos campos `unit` , `authorization` e `data` , caso não preenchidos, manterão as informações anteriores.
{% endhint %}

* [Exemplo de requisição](#requisicoeswebhook)

## List webhooks

<mark style="color:blue;">`GET`</mark> `https://api.acessorh.com.br/v1/integrations/webhooks`

#### Query Parameters

| Name    | Type    | Description                                                    |
| ------- | ------- | -------------------------------------------------------------- |
| account | string  | UID da empresa onde os webhooks serão listados.                |
| skip    | integer | Indica a quantidade de webhooks que serão pulados (paginação). |
| limit   | integer | Limite de webhooks que serão listados (paginação).             |

#### Headers

| Name          | Type   | Description                                                    |
| ------------- | ------ | -------------------------------------------------------------- |
| Authorization | string | Token de acesso adquirido pela plataforma Identity *(bearer)*. |

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

```
{
    "total": 2,
    "results": [
        {
            "account": "2d9174c4-06b7-4956-a5dc-8824d8a2f49e",
            "authorization": {
                "kind": "secret"
            },
            "data": {
                "url": "https://api.teste.com.br/callback",
                "events": [
                    "position-created",
                    "position-archived",
                    "position-completed"
                ]
            },
            "uid": "a7c001fe-50bb-41cd-a910-da27e538726f",
            "unit": "82930d53-e99a-4927-b31e-4fdc7090395d"
        },
        {
            "account": "2d9174c4-06b7-4956-a5dc-8824d8a2f49e",
            "authorization": {
                "kind": "basic"
            },
            "data": {
                "url": "https://api.teste.com.br/callback/applied",
                "events": [
                    "position-applied"
                ]
            },
            "uid": "32b3f3d0-59dc-4cf1-9b4d-4ffcd04a14e4",
            "unit": "82930d53-e99a-4927-b31e-4fdc7090395d"
        }
    ]
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
Caso não seja inserido os parâmetros `limit` e `skip` , os valores padrões serão, respectivamente, 100 e 0.

O parâmetro `limit` tem o seu valor máximo como 100.
{% endhint %}

## Delete webhook

<mark style="color:red;">`DELETE`</mark> `https://api.acessorh.com.br/v1/integrations/webhook`

#### Query Parameters

| Name    | Type   | Description                                  |
| ------- | ------ | -------------------------------------------- |
| uid     | string | UID do webhook a ser removido.               |
| account | string | UID da empresa onde o webhook será removido. |

#### Headers

| Name          | Type   | Description                                                    |
| ------------- | ------ | -------------------------------------------------------------- |
| Authorization | string | Token de acesso adquirido pela plataforma Identity *(bearer)*. |

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

```
```

{% endtab %}
{% endtabs %}

## Ping webhook

<mark style="color:green;">`POST`</mark> `https://api.acessorh.com.br/v1/integrations/webhook/ping`

#### Headers

| Name          | Type   | Description                                                    |
| ------------- | ------ | -------------------------------------------------------------- |
| Authorization | string | Token de acesso adquirido pela plataforma Identity *(bearer)*. |

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

```
```

{% endtab %}
{% endtabs %}

* [Descrição do body JSON da request](#descricao-do-body-json-da-request-2)
* [Exemplo de requisição](#exemplo-de-requisicao-2)

### Descrição do body JSON da request

| Chave                                                   | Tipo   | Descrição                                   |
| ------------------------------------------------------- | ------ | ------------------------------------------- |
| <p><strong>id</strong></p><p><em>required</em></p>      | string | UID do webhook que será testado.            |
| <p><strong>account</strong></p><p><em>required</em></p> | string | UID da empresa do webhook que será testado. |

### Exemplo de requisição

```
{
	"id": "b712a527-efec-4e02-83d5-95cbd7c269f9",
	"account": "2d9174c4-06b7-4956-a5dc-8824d8a2f49e"
}
```

## List webhook deliveries

<mark style="color:blue;">`GET`</mark> `https://api.acessorh.com.br/v1/integrations/webhook/deliveries`

#### Query Parameters

| Name    | Type   | Description                                                   |
| ------- | ------ | ------------------------------------------------------------- |
| uid     | string | UID do webhook onde as entregas serão listadas.               |
| account | string | UID da empresa na qual o webhook pertence.                    |
| skip    | string | Indica a quantidade de entregas que serão puladas (paginação) |
| limit   | string | Limite de entregas que serão listadas (paginação)             |

#### Headers

| Name          | Type   | Description                                                    |
| ------------- | ------ | -------------------------------------------------------------- |
| Authorization | string | Token de acesso adquirido pela plataforma Identity *(bearer)*. |

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

```
{
    "total": 2,
    "results": [
        {
            "account": "2d9174c4-06b7-4956-a5dc-8824d8a2f49e",
            "data": {
                "request": {
                    "headers": {
                        "Accept": [
                            "application/json"
                        ],
                        "Acesso-Delivery-Id": [
                            "c8815dab-d6be-4a8d-9c68-62ee849fed39"
                        ],
                        "Acesso-Signature": [
                            "jZXci/I69WDH5y7Vt2I3daJRWL9jX7pf2eL9+676KWo="
                        ],
                        "Content-Type": [
                            "application/json"
                        ],
                        "User-Agent": [
                            "go-resty/1.11.0 (https://github.com/go-resty/resty)"
                        ]
                    },
                    "payload": {
                        "integration": "0a22e148-6610-4d38-bcb7-20bbc465d43c",
                        "position": "302fc619-2054-448c-a9f8-d1093fcaddf2",
                        "position-number": null,
                        "unit": "8a240932-7c99-40da-aeb8-37a89308c642",
                        "event": "position-archived"
                    }
                },
                "response": {
                    "headers": {
                        "Content-Length": [
                            "202"
                        ],
                        "Content-Type": [
                            "application/json"
                        ],
                        "Date": [
                            "Thu, 26 Dec 2019 16:01:26 GMT"
                        ]
                    },
                    "status": 200,
                    "body": "eyJldmVudCI6InBvc2l0aW9uLWFyY2hpdmVkIiwiaW50ZWdyYXRpb24iOiIwYTIyZTE0OC02NjEwLTRkMzgtYmNiNy0yMGJiYzQ2NWQ0M2MiLCJwb3NpdGlvbiI6IjMwMmZjNjE5LTIwNTQtNDQ4Yy1hOWY4LWQxMDkzZmNhZGRmMiIsInBvc2l0aW9uLW51bWJlciI6bnVsbCwidW5pdCI6IjhhMjQwOTMyLTdjOTktNDBkYS1hZWI4LTM3YTg5MzA4YzY0MiJ9Cg=="
                }
            },
            "id": "c8815dab-d6be-4a8d-9c68-62ee849fed39",
            "integration": "0a22e148-6610-4d38-bcb7-20bbc465d43c",
            "organization": "896ffd1d-a3a9-43df-a2e8-eed057fe40e6",
            "timestamp": "2019-12-26T16:01:26.225Z",
            "type": "webhook"
        },
        {
            "account": "2d9174c4-06b7-4956-a5dc-8824d8a2f49e",
            "data": {
                "request": {
                    "headers": {
                        "Accept": [
                            "application/json"
                        ],
                        "Acesso-Delivery-Id": [
                            "cb549c0f-ae08-44bc-b729-7d46b9b6c4cc"
                        ],
                        "Acesso-Signature": [
                            "tClrDZ0umoMpVKKz6JpMmKXxeu3BVdU9bcUScKl5b6Q="
                        ],
                        "Content-Type": [
                            "application/json"
                        ],
                        "User-Agent": [
                            "go-resty/1.11.0 (https://github.com/go-resty/resty)"
                        ]
                    },
                    "payload": {
                        "integration": "0a22e148-6610-4d38-bcb7-20bbc465d43c",
                        "position": "302fc619-2054-448c-a9f8-d1093fcaddf2",
                        "position-number": null,
                        "unit": "8a240932-7c99-40da-aeb8-37a89308c642",
                        "event": "position-completed"
                    }
                },
                "response": {
                    "headers": {
                        "Content-Length": [
                            "203"
                        ],
                        "Content-Type": [
                            "application/json"
                        ],
                        "Date": [
                            "Thu, 26 Dec 2019 16:00:59 GMT"
                        ]
                    },
                    "status": 200,
                    "body": "eyJldmVudCI6InBvc2l0aW9uLWNvbXBsZXRlZCIsImludGVncmF0aW9uIjoiMGEyMmUxNDgtNjYxMC00ZDM4LWJjYjctMjBiYmM0NjVkNDNjIiwicG9zaXRpb24iOiIzMDJmYzYxOS0yMDU0LTQ0OGMtYTlmOC1kMTA5M2ZjYWRkZjIiLCJwb3NpdGlvbi1udW1iZXIiOm51bGwsInVuaXQiOiI4YTI0MDkzMi03Yzk5LTQwZGEtYWViOC0zN2E4OTMwOGM2NDIifQo="
                }
            },
            "id": "cb549c0f-ae08-44bc-b729-7d46b9b6c4cc",
            "integration": "0a22e148-6610-4d38-bcb7-20bbc465d43c",
            "organization": "896ffd1d-a3a9-43df-a2e8-eed057fe40e6",
            "timestamp": "2019-12-26T16:00:59.776Z",
            "type": "webhook"
        }
    ]
}
```

{% endtab %}
{% endtabs %}

## Get webhook delivery

<mark style="color:blue;">`GET`</mark> `https://api.acessorh.com.br/v1/integrations/webhook/delivery`

#### Query Parameters

| Name    | Type   | Description                                                      |
| ------- | ------ | ---------------------------------------------------------------- |
| uid     | string | UID da entrega a ser exibida.                                    |
| account | string | UID da empresa do webhook do qual a entrega solicitada pertence. |

#### Headers

| Name          | Type   | Description                                                    |
| ------------- | ------ | -------------------------------------------------------------- |
| Authorization | string | Token de acesso adquirido pela plataforma Identity *(bearer)*. |

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

```
{
    "account": "2d9174c4-06b7-4956-a5dc-8824d8a2f49e",
    "data": {
        "request": {
            "headers": {
                "Accept": [
                    "application/json"
                ],
                "Acesso-Delivery-Id": [
                    "c8815dab-d6be-4a8d-9c68-62ee849fed39"
                ],
                "Acesso-Signature": [
                    "jZXci/I69WDH5y7Vt2I3daJRWL9jX7pf2eL9+676KWo="
                ],
                "Content-Type": [
                    "application/json"
                ],
                "User-Agent": [
                    "go-resty/1.11.0 (https://github.com/go-resty/resty)"
                ]
            },
            "payload": {
                "integration": "0a22e148-6610-4d38-bcb7-20bbc465d43c",
                "position": "302fc619-2054-448c-a9f8-d1093fcaddf2",
                "position-number": null,
                "unit": "8a240932-7c99-40da-aeb8-37a89308c642",
                "event": "position-archived"
            }
        },
        "response": {
            "headers": {
                "Content-Length": [
                    "202"
                ],
                "Content-Type": [
                    "application/json"
                ],
                "Date": [
                    "Thu, 26 Dec 2019 16:01:26 GMT"
                ]
            },
            "status": 200,
            "body": "eyJldmVudCI6InBvc2l0aW9uLWFyY2hpdmVkIiwiaW50ZWdyYXRpb24iOiIwYTIyZTE0OC02NjEwLTRkMzgtYmNiNy0yMGJiYzQ2NWQ0M2MiLCJwb3NpdGlvbiI6IjMwMmZjNjE5LTIwNTQtNDQ4Yy1hOWY4LWQxMDkzZmNhZGRmMiIsInBvc2l0aW9uLW51bWJlciI6bnVsbCwidW5pdCI6IjhhMjQwOTMyLTdjOTktNDBkYS1hZWI4LTM3YTg5MzA4YzY0MiJ9Cg=="
        }
    },
    "id": "c8815dab-d6be-4a8d-9c68-62ee849fed39",
    "integration": "0a22e148-6610-4d38-bcb7-20bbc465d43c",
    "organization": "896ffd1d-a3a9-43df-a2e8-eed057fe40e6",
    "timestamp": "2019-12-26T16:01:26.225Z",
    "type": "webhook"
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://acessorh.gitbook.io/project/api/webhooks.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
