Integrations: API Applications
API Applications are a way to programmatically interact with Linkurious Enterprise's API securely. They allow you to define a set of permissions and generate an API key that can be used to authenticate requests to the API.
Principles
An API Application is defined by:
- A name
- A list of user groups that the application can act on behalf of.
- A list of API actions that the application is allowed to perform.
Once created, an API Application is associated with an API key, which is a secret that can be used to authenticate requests to the API.
Using an API Application
⚠️ You should make sure that you are accessing the API using HTTPS to ensure that your API key is not exposed.
To use an API Application, you need:
- An API key which matches an existing API Application
- A user email. The user must be a member of a group that the API Application is allowed to act on behalf of.
When making requests to the API, use the Basic Authentication scheme with the following credentials:
- User: The email of the user that the API Application is acting on behalf of.
- Password: The API key associated with the API Application.
If your HTTP client library does not natively support Basic Authentication, the following is equivalent to the above:
- Define CREDENTIALS as the Base64 encoding of
USER_EMAIL:API_KEY(i.e., concatenation of the user email, the:character, and the API key). - Add the
Authorizationheader to your HTTP requests with this value:Basic CREDENTIALS(i.e., concatenation of the stringBasicand the CREDENTIALS string created above).
How to create an API Application
To create an API Application, several options are available:
ℹ️ API Applications that can act on behalf of the "admin" group can only be created using environment variables.
Using the API
You can use the API to create an API Application. The response body contains the generated API key.
Using environment variables
You can use a set of environment variables to create an API Application that can act on behalf of the "admin" group. This API Application will be entitled to all existing API Actions.
This can be handy if you need to use the API before any user has been created in the system.
Follow these steps:
- Set the
LKE_ADMIN_APPLICATION_NAMEandLKE_ADMIN_APPLICATION_APIKEYenvironment variables on the application server. - Use the API Application. You can use
user@linkurio.usas the user's email in case no existing user exists on the system yet.