Creating an API key¶
Note
The secret key is only visible when creating an API key. Save it in a secure place, because it cannot be shown again afterwards.
Note
The body does not contain the attributes id, created, and modified. The system sets the values of these attributes after the entry is created.
Sends a POST request to the endpoint /user/{id}/api-keys.
Description¶
The Create-API-Key request allows the user to create a new API key for a user account of the organisation.
Requirements¶
Values of the request: User-ID {id}d}
Objects: ApiKeyVO
Request¶
To create an API key for a user account of the organisation, the User-ID {id} needs to be added to the path of the request.
For a detailed specification of which information is required to create an API key for a user account, one or more objects ApiKeyVO with the following attributes need to be defined in the body:
| Attributes | Description | Values |
|---|---|---|
name |
The individual name for the API key. | string |
As a result, the user gets one or more objects ApiKeyVO with the information about the new API key.
The object provides the following information:
| Attributes | Description | Values |
|---|---|---|
key |
The token of the API key. | string |
secret |
The secret for the authentication over Rest API. | string |
name |
The individual name for the API key. | string |
deleted |
Shows if the key was deleted. |
|
id |
The ID of the entry. | integer |
modified |
The last modification date in ISO 8601 format. | string($date-time) |
created |
The creation date in ISO 8601 format. | string($date-time) |
Example¶
Example request body:
Responses¶
The following responses are available:
| STATUS CODE | DESCRIPTION |
|---|---|
| 201 | The request has succeeded and a new object has been created. |
| 400 | The request was unsuccessful. The request was invalid or information is missing. |
| 401 | The request has not succeeded because the user authentication was incorrect. |
| 403 | The request has not succeeded because the user does not have the right permissions. |