# Iniciando os testes

Antes de iniciar é necessário ler a [📘](http://api.espiaonfe.com.br/) [documentação](https://api.espiaonfe.com.br).

### Seguem abaixo as etapas para poder realizar os testes da integração via API.

1. Para poder realizar os testes, recomendamos a utilização do sistema [Postman](https://www.postman.com/)
2. Como exemplo de teste vamos utilizar a requisição abaixo:

<div align="left"><figure><img src="/files/FEe6j6lzQuej8bsjHfO4" alt=""><figcaption></figcaption></figure></div>

3. No Postman, informe os parâmetros conforme demonstrado abaixo para poder consultar o Resumo das NF-e's.

**cnpjCpf:** {Cnpj/Cpf da empresa que será consultada}\
**dataInicial:** Data de emissão inicial do período da NF-e (formato yyyy-MM-dd)\
**dataFinal:** Data de emissão final do período da NF-e (formato yyyy-MM-dd)\
**modelo:** 55 (NF-e), 65 (NFC-e) ou 59 (Sat)

<div align="left"><figure><img src="/files/izHSzr2s6fFenooWmbQD" alt=""><figcaption></figcaption></figure></div>

4. Agora no **HEADER** informe os tokens de acesso da autenticação conforme demonstrado abaixo.

<div align="left"><figure><img src="/files/36oDrABzqtRyGKiQsroE" alt=""><figcaption></figcaption></figure></div>

5. Clique no botão **Send**.

<div align="left"><figure><img src="/files/cUeTLlbg9treeG3YuwIM" alt=""><figcaption></figcaption></figure></div>

6. Pronto, será retornada a resposta da requisição com as informações preenchidas nos campos.

<div align="left"><figure><img src="/files/IlLmbI2RErl1Sx7ruqpm" alt=""><figcaption></figcaption></figure></div>

**Como testar o exemplo do item 3 utilizando a linguagem de programação C#?**\
Segue abaixo um exemplo:

```
var client = new RestClient("http://api.espiaonfe.com.br");
var request = new RestRequest("/v1-cloud/consulta/periodo/nfe-resumo", Method.GET);
request.AddHeader("esp-cloud-token", {Informe o token de acesso da conta});
request.AddHeader("user-token", {Informe o token de acesso do usuário});
request.AddParameter(cnpjCpf", 99999999999999);
request.AddParameter(dataInicial", 2022-08-01);
request.AddParameter(dataFinal", 2022-08-25);
request.AddParameter(modelo", 55);
IRestResponse response = client.Execute(request);
```


---

# 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://ajuda.espiaonfe.com.br/api-de-integracao/iniciando-os-testes.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.
