Skip to content

Required request headers

Most API requests require the following headers:

  • X-Amica20-ApiKey: developer API key.
  • X-Amica20-LicenseKey: licensed company identifier & license key.
  • X-Amica20-ApplicationId: client application ID.

See below for details.

X-Amica20-ApiKey header

The developer API key.

A request with a valid token but an invalid or missing API key will return 403 Forbidden.

Usage example:

X-Amica20-ApiKey: 0e6f7b10-4de2-4140-a95f-c7f84ff5bd84

Info

If you don't have an API Key yet, you can request one. See the API Keys page.

X-Amica20-LicenseKey header

The license key that corresponds to the company you wish to work on. The user receives a company (Azienda) key when they purchase any Amica 20 software title.

A request with a valid token but an invalid or missing license key will return 403 Forbidden. Likewise, a request with both a valid token and valid license key, but the latter issued for a different company than the one accessed, will get a 403 Forbidden response.

Usage example:

X-Amica20-LicenseKey: 0f96e4b7-998f-4d79-b3ab-6927a094580b

Info

For an API Key vs. License Key comparison, see the API keys page.

X-Amica20-ApplicationId header

An Application ID. While the value of this header is free, we suggest picking a unique value for every application consuming the API. The application ID is logged with every request and is helpful in debugging and logging.

Usage example:

X-Amica20-ApplicationId: MyApp

Complete request example

Once the authentication token and the required header values have been collected, it is possible to perform requests against both the Customer and Admin APIs.

In this example, we request a stock item:

curl -X GET --location 'https://customerws1.amica20.it/api/{version}/{companyId}/articolo/{articoloId}' \
    --header 'X-Amica20-ApplicationId: MyApp' \
    --header 'X-Amica20-ApiKey: 0e6f7b10-4de2-4140-a95f-c7f84ff5bd84' \
    --header 'X-Amica20-LicenseKey: 0f96e4b7-998f-4d79-b3ab-6927a094580b' \
    --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'

HTTP/1.1 200 OK

Info

The X-Amica20-LicenseKey header value must match the license key assigned to the company identified by companyId value contained in the URL.