You can generate API keys that can be added to the x-api-key
header to authenticate API requests.
Generate an API key
- Click on the drop-up menu with your name in the side panel.
- Navigate to Settings > API Keys.
- Click on the + ADD NEW button.
- Enter a name for the key and click Yes.
![Fig. 1: Generating an API key](https://files.readme.io/70fb29c-Screenshot_from_2023-11-28_17-53-37.png)
Fig. 1: Generating an API key
- Click on Copy And Close. Save the API key somewhere safe.
![Fig. 2: Copy the API key](https://files.readme.io/404ef3b-Screenshot_from_2023-11-28_17-53-56.png)
Fig. 2: Copy the API key
The API key cannot be viewed or copied after this step.
Performing API tests using the API key
Test the API in Zenskar documentation
- Head over to the API documentation you would like to test.
- Add the API key to the header as shown below:
![Fig. 3: Preparing for an API test](https://files.readme.io/0145ffd-Screenshot_from_2023-12-06_14-35-20.png)
Fig. 3: Preparing for an API test
- Some APIs will require you to fill in the mandatory
organization
query parameter.
![Fig. 4: The mandatory query parameter: organization](https://files.readme.io/d8624d2-Screenshot_from_2023-11-28_18-10-53.png)
Fig. 4: The mandatory query parameter: organization
The organization
query parameter can be obtained by navigating to Settings > General. The organization
query parameter accepts a valid universally unique identifier (UUID).
![Fig. 5: Obtaining the organization UUID](https://files.readme.io/5e4d48c-Screenshot_from_2024-05-10_11-49-07.png)
Fig. 5: Obtaining the organization UUID
Note
If the mandatory
organization
query parameter is left empty or if a wrong UUID is entered, you may receive an HTTP 403 error with the following message in the response:{ "Message": "User is not authorized to access this resource with an explicit deny" }
![Fig. 6: HTTP 403 error response](https://files.readme.io/97b41a5-Screenshot_from_2023-12-06_14-30-39.png)
Fig. 6: HTTP 403 error response
- Fill in the other necessary optional query parameters.
- Click on Try It!. A successful test will result in an HTTP 200 status with a proper JSON response as shown below.
![Fig.7: HTTP 200 success response](https://files.readme.io/1d6ca6d-Screenshot_from_2023-12-06_14-41-43.png)
Fig.7: HTTP 200 success response
Test the API using tools like Postman
The API keys can be used to test the APIs using tools such as Postman or Thunder Client. You should refer to tool-specific instructions.
Deleting an API key
- Click on the drop-up menu with your name in the side panel.
- Navigate to Settings > API Keys.
- Click on the button with the trashcan icon.
![Fig. 6: Deleting an API key](https://files.readme.io/0c5c9be-Screenshot_from_2023-11-28_18-17-46.png)
Fig. 8: Deleting an API key