# Histórico de eventos

El objetivo principal de este endpoint es permitir la recuperación del historial de actividad de un documento específico. Además, esta ruta te da la posibilidad de obtener el historial en formato JSON estándar o en formato de archivo PDF para descargarlo.

De esta manera, puedes acceder fácilmente al detalle de las acciones realizadas sobre el documento, ya sea para realizar un seguimiento o para tener un registro en PDF que puedas guardar.

#### <mark style="color:blue;">`GET`</mark> `https://api.zapsign.com.br/api/v1/docs/signer-log/{{doc_token}}?download_pdf=boolean`

#### Encabezado

<table><thead><tr><th width="175">Nombre</th><th width="103">Tipo</th><th>Descripción</th></tr></thead><tbody><tr><td>Authorization<mark style="color:red;">*</mark></td><td>string</td><td>API token prefijo con la palabra "Bearer". Ex: Bearer c7f35c84-7893-4087-b4fb-d1f06c23</td></tr></tbody></table>

#### Path Parameters

<table><thead><tr><th width="156">Nombre</th><th width="79">Tipo</th><th>Descripción</th></tr></thead><tbody><tr><td>doc_token</td><td>string</td><td>Token del documento que quieres consultar.</td></tr></tbody></table>

#### Query Parameters

<table><thead><tr><th width="156">Nombre</th><th width="106">Tipo</th><th>Descripción</th></tr></thead><tbody><tr><td>download_pdf</td><td>boolean</td><td><p>Este valor te permite decidir el tipo de respuesta que devolverá el endpoint.</p><p>Si el valor es <code>true</code>, la respuesta será un archivo PDF con el historial de actividad del documento. En caso de que sea <code>false</code> o no se haya completado, la respuesta será una lista en formato JSON con los detalles de cada actividad asociada al token del documento enviado.<br></p></td></tr></tbody></table>

#### Sucessfull examples

{% tabs %}
{% tab title="Status 200 - JSON Format" %}

```json
[
    {
        "time": "2024-11-27 17:44:32.117577+00:00",
        "user": "jose@email.com",
        "event": "Documento firmado",
        "description": "Documento firmado por jose@email.com"
    },
    {
        "time": "2024-11-27 17:45:29.398835+00:00",
        "user": "jose@email.com",
        "event": "Validación de reconocimiento facial",
        "description": "Validación del rostro de jose@email.com con la foto del documento de identidad (anexo en el infome de firmas)"
    },
    {
        "time": "2024-11-27 17:45:40.904009+00:00",
        "user": "jose@email.com",
        "event": "Documento visualizado",
        "description": "Documento visualizado por jose@email.com"
    },
    {
        "time": "2024-11-21 05:18:45.733798+00:00",
        "user": "jose@email.com",
        "event": "Documento creado",
        "description": "El documento fue creado por ejemplo@email.com via web"
    }
]
```

{% endtab %}

{% tab title="Status 200 - PDF file" %}
In this way, the endpoint returns a direct download file, in the following model:

<figure><img src="https://content.gitbook.com/content/5FrVBe47d9qwlLisqx07/blobs/1sxQhRSFaxT5Y7Sm7MVf/image.png" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

#### Errors examples

{% tabs %}
{% tab title="Status 401 - Unauthorized" %}
For this error, the endpoint returns the value 401 in the StatusCode attribute, indicating that the token sent does not have permission to view the information in this document.

In this case, we suggest that you check whether the token sent in the Headers is correct according to the example already described above.
{% endtab %}

{% tab title="Status 404 - Not Found" %}
In this error, the endpoint returns the StatusCode with a value of 404, indicating that the doc token sent was not found.&#x20;

When this error occurs, we suggest checking whether the token sent in the endpoint url was the correct token.
{% endtab %}
{% endtabs %}
