Endpoints Package
The endpoints package is a set of Python scripts, one per IaaS API call, organized in the same sections as this documentation. Each script builds the API-CLIENT-KEY and AUTHORIZATION headers, sends the request and prints the status and the response. It is meant for those who are integrating and want to test a call in Sandbox without writing the signature from scratch.
Configure
-
Install the dependencies:
pip install -r requirements.txt. -
Copy
.env.exampleto.env, at the package root, and fill in:Variable What it is BASE_URLBase URL of the host of your profile and environment. See Environments (Hosts). API_KEYYour integration's API key. PRIVATE_KEY_PATHPath to the .pemfile of your private key.ALGORITHMYour key's algorithm: RS256for RSA;ES256,ES384orES512for EC P-256, P-384 or P-521. The EC P-521 key from the key exchange usesES512. -
Open the script, replace the values marked with
<...>and run it. Start with5.1 - Primeiros passos/5.1 - GET Teste de autenticação.py.
Not every call exists on every host. The header of each script lists the hosts that expose that call, and the package's README.md has the table per folder. A call to another profile's host is rejected with Invalid API Key.
The scripts use fictitious CPFs and CNPJs. Do not use real data from natural persons or legal entities in Sandbox.