---
description: >-
  Responsável por permitir ao integrador a consulta dos XMLs relacionados às
  NFS-es recebidas.
---

# Consultar XML importado

### Endpoint

<mark style="color:blue;">`GET`</mark> `https://sandbox-api.invoisys.io/v1/nfse-entrada/obter-xml-chave/{ambiente}/{id}`

#### Headers

| Name          | Type   | Description        |
| ------------- | ------ | ------------------ |
| Accept        | string | `application/json` |
| Authorization | string | `bearer <valor>`   |

#### Request Body por ID

| 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> |
| idArquivo | integer | ID invoiSys da NFS-e                                                                                            |

#### Response

{% tabs %}
{% tab title="200 - Sucesso" %}
```csharp
	
{
  "id": 4207,
  "xml": "PG5mZVByb2MgeG1sbnM9Imh0dHA6Ly93d3cucG9ydGFsZmlzY2FsLmluZi5ici9uZmUiIHZlcnNhbz0iNC4wMCI+PE5GZSB4bWxucz0iaHR0cDovL3d3dy5wb3J0YWxmaXNjYWwuaW5mLmJyL25mZSI+PGluZk5GZSBJZD0iTkZlMzUyNDA5MDU4Njg1NzQwMDIwNjI1NTAwMjAwMDAyMjM2OTE2MjkwMjg2NDQiIHZlcnNhbz0iNC4wMCI+PGlkZT48Y1VGPjM1PC9jVUY+PGNORj42MjkwMjg2NDwvY05GPjxuYXRPcD5EZXZvbHXDp8OjbyBkZSBjb21wcmEgcGFyYSBjb21lcmNpYWxpemHDp8OjbzwvbmF0T3A+PG1vZD41NTwvbW9kPjxzZXJpZT4yPC9zZXJpZT48bk5GPjIyMzY5PC9uTkY+PGRoRW1pPjIwMjQtMDktMDVUMTA6Mjk6MDAtMDM6MDA8L2RoRW1pPjxkaFNhaUVudD4yMDI0LTA5LTA1VDEwOjI5OjAwLTAzOjAwPC9kaFNhaUVudD48dHBORj4xPC90cE5GPjxpZERlc3Q+MTwvaWREZXN0PjxjTXVuRkc+MzUyNDQwMjwvY011bkZHPjx0cEltcD4xPC90cEltcD48dHBFbWlzPjE8L3RwRW1pcz48Y0RWPjQ8L2NEVj48dHBBbWI+MjwvdHBBbWI+PGZpbk5GZT40PC9maW5ORmU+PGluZEZpbmFsPjA8L2luZEZpbmFsPjxpbmRQcmVzPjE8L2luZFByZXM+PHByb2NFbWk+MDwvcHJvY0VtaT48dmVyUHJvYz5TQVAgTkZFIDQuMDA8L3ZlclByb2M+PE5GcmVmPjxyZWZORmU+MzUyNDA5MzE1NjUxMDQwMDMwMDE1NTAwMTAwMDE0ODY5NzE1NDUwOTgyNjg8L3JlZk5GZT48L05GcmVmPjwvaWRlPjxlbWl0PjxDTlBKPjA1ODY4NTc0MDAyMDYyPC9DTlBKPjx4Tm9tZT5DT01FUkNJQUwgWkFSQUdPWkEgSU1QLiBFIEVYUC4gTFREQTwveE5vbWU+PGVuZGVyRW1pdD48eExncj5BVkVOSURBIEdFVMOaTElPIERPUk5FTEVTIFZBUkdBUzwveExncj48bnJvPjE1OTE8L25ybz48eEJhaXJybz5KQVJESU0gQ0FMSUbDk1JOSUE8L3hCYWlycm8+PGNNdW4+MzUyNDQwMjwvY011bj48eE11bj5KQUNBUkXDjTwveE11bj48VUY+U1A8L1VGPjxDRVA+MTIzMDUwMDA8L0NFUD48Y1BhaXM+MTA1ODwvY1BhaXM+PHhQYWlzPkJyYXNpbDwveFBhaXM+PC9lbmRlckVtaXQ+PElFPjM5MjI2MDQ..",",
  "mensagem": "Sucesso"
}
```
{% endtab %}

{% tab title="400 - NFS-e inexistente" %}
```csharp
{
  "id": 4208,
  "xml": "",
  "mensagem": "NFS-e não existe na base de dados"
}
```
{% 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 🎈

* [Importar XML](../ct-e/api-entrada-de-nf-e-por-xml)

## Referências à API 📌

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