# Obtener PDF del formulario

Para obtener el PDF de un formulario particular que ya ha sido insertado en Persat se debe realizar un GET como el que se muestra a continuación.

<mark style="color:blue;">`GET`</mark> `https://api.persat.com.ar/v1/digital-forms/pdf/form_id`

#### Path Parameters

| Name                                       | Type   | Description                   |
| ------------------------------------------ | ------ | ----------------------------- |
| form\_id<mark style="color:red;">\*</mark> | String | Identificador del formulario. |

#### Query Parameters

| Name   | Type   | Description                                                                                                      |
| ------ | ------ | ---------------------------------------------------------------------------------------------------------------- |
| format | String | Si se envía `"base64"`, el PDF se devolverá en base64. Si no se envía, la API responderá con un archivo binario. |

#### Headers

| Name                                            | Type   | Description     |
| ----------------------------------------------- | ------ | --------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer API\_KEY |

### Ejemplo en formato binario

{% hint style="info" %}
Las respuestas en formato binario retornan directamente la descarga del archivo.
{% endhint %}

#### Request con curl

```bash
curl -H "Authorization: Bearer API_KEY" \
     -J -O \
     https://api.persat.com.ar/v1/digital-forms/pdf/197
```

#### Respuesta

{% tabs %}
{% tab title="200: OK La consulta se ejecutó con éxito" %}

```json
HTTP/1.1 200 OK
Content-Type: application/pdf
Transfer-Encoding: chunked
Content-Disposition: attachment; filename="NOTA_DE_PEDIDO_197.pdf"

<Binary Data>
```

{% endtab %}

{% tab title="404: Not Found No se encontro el formulario requerido" %}

```json
HTTP/1.1 404 NOT_FOUND
Content-Type: application/json

{
    "success": false,
    "error": {
        "status": 404,
        "type": "NOT_FOUND",
        "userMessage": "No hay un formulario con este numero: 197"
    }
}
```

{% endtab %}
{% endtabs %}

### Analizando la Respuesta en formato base64

{% tabs %}
{% tab title="200: OK La consulta se ejecutó con éxito" %}

```json
{
    "success": true,
    "data": {
        "pdf": "JVBERi0xLjQKJdPr6eEKMSAwIG9iago8PC9DcmVh[...]", // Base64
        "name": "NOTA_DE_PEDIDO_197.pdf",
    }
}
```

{% endtab %}

{% tab title="404: Not Found No se encontro el formulario requerido" %}

```json
{
    "success": false,
    "error": {
        "status": 404,
        "type": "NOT_FOUND",
        "userMessage": "No hay un formulario con este numero: 197"
    }
}
```

{% endtab %}
{% endtabs %}

**pdf:** Es un string. Representa el pdf en base64.

**name:** Es un string. Nombre sugerido del pdf.

### Ejemplo de PDF descargado

<figure><img src="/files/5MwWejNa4Q9lULLwmn2M" alt=""><figcaption><p>Ejemplo de pdf descargado</p></figcaption></figure>


---

# 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://docs.api.persat.com.ar/modulos/formularios-digitales/obtener-pdf-del-formulario.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.
