> For the complete documentation index, see [llms.txt](https://ajuda.espiaonfe.com.br/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ajuda.espiaonfe.com.br/api-de-integracao/iniciando-os-testes.md).

# 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="https://1086762934-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqoJpeeYAUN8570QfuPzY%2Fuploads%2FqE8Eg4Dfz2D2X77vUrl5%2Fapi-requisicao-historico.png?alt=media&amp;token=a9fc538b-70ea-4253-9f18-bfc7010bd696" 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="https://1086762934-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqoJpeeYAUN8570QfuPzY%2Fuploads%2F7uY90MPdwdcK0oHrpNOo%2Fpostman-resumo-nfe.png?alt=media&amp;token=272fd11b-07b2-402c-8791-e6295962eea6" 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="https://1086762934-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqoJpeeYAUN8570QfuPzY%2Fuploads%2FdRjP6kWAibYFl0Tqwojd%2Fpostman-header.png?alt=media&amp;token=03bf5e93-19a9-4864-9376-d4ce1bdd1087" alt=""><figcaption></figcaption></figure></div>

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

<div align="left"><figure><img src="https://1086762934-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqoJpeeYAUN8570QfuPzY%2Fuploads%2FiUjoqgKPm4qi2JOYq6ZP%2Fpostman-send.png?alt=media&amp;token=f179ed0b-192f-4165-9b57-61c9dc8a02f3" 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="https://1086762934-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqoJpeeYAUN8570QfuPzY%2Fuploads%2F6MR8hOEkK2Ve6CXEwRY0%2Fpostman-retorno.png?alt=media&amp;token=d7d2c73b-5683-4c6b-987f-03b3f24621e7" 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://ajuda.espiaonfe.com.br/api-de-integracao/iniciando-os-testes.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
