# Download

## Obter Ficheiro SAF-T(PT)

## Descarrega o ficheiro XML do SAF-T(PT), compactado em arquivo ZIP.

<mark style="color:blue;">`GET`</mark> `https://api.cloudinvoice.net/saft/:id/download/`

#### Path Parameters

| Name | Type    | Description                                        |
| ---- | ------- | -------------------------------------------------- |
| id   | integer | O ID do registo SAF-T(PT) que pretende descarregar |

{% hint style="warning" %}
Ao contrário do habitual na API CloudInvoice, a resposta a este endpoint é dada com Content-Type "**application/zip**", já que o conteúdo é o byte stream de um ficheiro ZIP.

É também incluido no header Content-Disposition da resposta o nome sugerido para o ficheiro.
{% endhint %}

{% tabs %}
{% tab title="Exemplo de Pedido" %}

```shell
curl https://api.cloudinvoice.net/saft/1/download/
    -H "Content-Type: application/json"
```

{% endtab %}
{% endtabs %}

Para ver exemplos de pedidos nas várias linguagens, consulte a página[ Exemplos de Pedidos.](/introducao/exemplos-de-pedidos.md)


---

# 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://apidocs.cloudinvoice.net/documentacao-api/saf-t-pt/download.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.
