Skip to content
Light
English

How to generate the API Token

The API Token for the REST Integration API is on the user record in Demander Web. Only a user with the Usuário Api group can be used in this integration.

Open Usuários and open the record.

The ApiToken field appears when the Usuário Api group is selected in Grupos de usuários. Without that group, the field stays hidden.

The value is not typed. Use Gerar to create a new token. The lock shows or hides the value. The icon next to the title copies the token.

  1. In Usuários, create a user or open an existing one.
  2. In Tipo, choose Empresa.
  3. If the Empresa field appears, fill it in. Someone who is already a user of type Empresa does not see this field: the user stays on the company of the person registering.
  4. In Grupos de usuários, select Usuário Api.
  5. Click Gerar in the ApiToken field.
  6. Save.

It is not possible to add other user groups when the Usuário Api group is added.

When a new token is generated and saved, the previous token stops working. The integration that still uses the old token stops authenticating until it receives the new one.

The Usuário Api group only applies to the Empresa type. Someone who is already a user of type Empresa does not see the Empresa field: the user stays on the company of the person registering. In other registrations, the company must be filled in. Outside the Empresa type, the record does not save.

With the group selected, ApiToken is required. Without a token, the record does not save.

This user does not log in to Demander Web, the App Demander, or the App Separação. The message is: “Este usuário é exclusivo da Api Rest e não acessa o Demander Web nem o aplicativo.”

The user must be active. An inactive user does not authenticate on the API.

In the call, send the user’s company and their ApiToken:

  • idEmpresa — company code of the user
  • x-api-token — ApiToken, in the request header

Example in the REST API overview.

Does the API Token work for several companies?

Section titled “Does the API Token work for several companies?”

No. The token belongs to the user, and the user in the Usuário Api group is linked to a single company. A partner does not use the same token for other companies.