Skip to main content

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.

Download the package (.zip)

Configure​

  1. Install the dependencies: pip install -r requirements.txt.

  2. Copy .env.example to .env, at the package root, and fill in:

    VariableWhat 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 .pem file of your private key.
    ALGORITHMYour key's algorithm: RS256 for RSA; ES256, ES384 or ES512 for EC P-256, P-384 or P-521. The EC P-521 key from the key exchange uses ES512.
  3. Open the script, replace the values marked with <...> and run it. Start with 5.1 - Primeiros passos/5.1 - GET Teste de autenticação.py.

The API key only works on your profile's host

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.

Important Notice!

The scripts use fictitious CPFs and CNPJs. Do not use real data from natural persons or legal entities in Sandbox.