# Importar anexo

### Endpoint

<mark style="color:green;">`POST`</mark> `https://sandbox-api.invoisys.io/v1/nfse-entrada/anexar`

#### Headers

| Name          | Type   | Description          |
| ------------- | ------ | -------------------- |
| Accept        | string | `application/jso​n​` |
| Authorization | string | `bearer <valor>`     |

#### Request Body

| Name     | Type    | Description                                                                                                     |
| -------- | ------- | --------------------------------------------------------------------------------------------------------------- |
| ambiente | integer | <p>Ambiente de importação do XML<br><code>ENUM: 1 - Produção; 2 - Homologação</code><br><code>TAM: 1</code></p> |
| idNFe    | string  | ID invoiSys do NFS-e                                                                                            |
| fileName | string  | Nome do arquivo a ser anexado                                                                                   |
| base64   | string  | Base64 do conteúdo que será anexado                                                                             |

#### Response

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

```csharp
{
  "idArquivo": "356553325169831937",
  "mensagem": "Anexo inserido com sucesso."
}
```

{% endtab %}

{% tab title="201 - Sobrescrita" %}

```csharp
{
  "idArquivo": "356553325169831937",
  "mensagem": "Anexo sobrescrito com sucesso."
}
```

{% endtab %}

{% tab title="400 - Base64 inválido" %}

```csharp
{
  "idArquivo": "",
  "mensagem": "Base64 inválido."
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}

#### Swagger

[Você pode acessar nossa API e realizar testes diretamente na nossa plataforma Swagger!](https://sandbox-api.invoisys.io/swagger/index.html)
{% endhint %}

## APIs Relacionadas 🎈

* [Consultar NFS-es via NSUi](https://integracao.gitbook.io/invoisys/endpoints/recebimento-notas/ct-e-1/api-entrada-de-nf-e-xml-resumido-obtido)

## Referências à API 📌

* Passo-a-Passo do Recebimento NFS-e
* Fluxograma - Recebimento NFS-e
