## Stub - Consulta usada em testes
Consulta utilizada em nossa suíte de testes sem a necessidade de depender de um portal online.


### Site URL
- https://infosimples.com/

### Request
POST endpoint: `https://api.infosimples.com/api/v2/consultas/stub/6Uqz4UmyYRxmGMFt`



| Parameter      | Description                                                 |
| -------------- | ----------------------------------------------------------- |
| token*         | The token that will authenticate and authorize the request. |
| arg_1*         | Arg_1                                                       |
| arg_2**        | Arg_2                                                       |
| file_fixture** | File_fixture                                                |

> * Required parameter.

> ** Optional parameter. Sometimes it is necessary to set at least one of the optional parameters for the service to work properly.


### Response examples (OK)
```json
"Houve um problema ao carregar este exemplo de resposta. Entre em contato com suporte@infosimples.com.br."
```


### Preview file

The preview file (`site_receipts`) in the response JSON is **generated by the source (website/app)** that processed the automation.

### Code snippets


#### Python
```python
# Tested with: Python 3.10.19, Python 3.14.0
import requests
import base64

url = 'https://api.infosimples.com/api/v2/consultas/stub/6Uqz4UmyYRxmGMFt'
args = {
  "arg_1":        "VALUE_OF_PARAMETER_ARG_1",
  "arg_2":        "VALUE_OF_PARAMETER_ARG_2",
  "file_fixture": base64.b64encode(open("path/to/file", "rb").read()).decode("ascii").replace("+", "-").replace("/", "_").rstrip("="),
  "token":        "WRITE_YOUR_TOKEN_HERE",
  "timeout":      "300"
}

response = requests.post(url, args)
response_json = response.json()
response.close()

if response_json['code'] == 200:
  print("Retorno com sucesso: ", response_json['data'])
elif response_json['code'] in range(600, 799):
  mensagem = "Resultado sem sucesso. Leia para saber mais: \n"
  mensagem += "Código: {} ({})\n".format(response_json['code'], response_json['code_message'])
  mensagem += "; ".join(response_json['errors'])
  print(mensagem)

print("Cabeçalho da consulta: ", response_json['header'])
print("URLs com arquivos de visualização (HTML/PDF): ", response_json['site_receipts'])
```


## We are here to help
Do you still need to figure something out? Reach us at [suporte@infosimples.com.br](mailto:suporte@infosimples.com.br) and our highly qualified support team will be happy to help.
