Managing Kion App API Keys
The Kion public API enables you to programmatically interact with Kion. This requires a Kion app API key that is generated within Kion.
Configuring API Access Settings
To enable the generation of App API Keys by users, enable it in the Kion global settings. With this setting enabled, administrators can generate their own App API Keys. Non-admin users will not be able to generate keys until they are explicitly given permission.
To enable API key generation:
- Navigate to Settings > System Settings.
- Under Application Settings, select App API Access.
- Enable the App API Key Generation option.
- Set the API Key Limit Per User to the maximum number of keys a single user can generate. The minimum value is 1, and the maximum value is 10.
- If you set the key limit to a value that is less than the number in use by a user, you will get an alert that says App API Key limit per user must be at least [value]. Click Learn More for the option to Download User API Key Report, which shows you which users have more keys than the number specified. Reduce their API keys to adjust the key limit.
- Configure the App API Key Lifespan if you want the app API keys to automatically expire after a certain number of days. Users will receive notifications a few days prior to their keys expiring.
- Click Update App API Access Settings to save the settings.
Administrators will now see a new option on the user menu at the top right corner of the screen called App API Keys.
Granting Users Permission to Generate App API Keys
By default, only admin users are allowed to generate app API keys. You can assign additional users permission through permission schemes.
You can choose to assign this permission by updating the global permissions scheme or by creating a custom permissions scheme. Here, we will go over how to update the global scheme. For information about custom schemes, see Add a Custom Permission Scheme.
To add the permission to roles in the global permission scheme:
- Navigate to Settings > Permissions.
- On the Global Permissions Scheme, click the ellipsis menu and select Edit.
- Assign the Manage Own App API Keys permission to any desired roles.
- Click Update Permission Scheme.
To assign users to a permission role:
- Navigate to Settings > Permissions.
- Select the Global Permissions tab.
- Locate a role that you have assigned Manage Own App API Keys to.
- Assign users or user groups to the role.
- Click Save.
For more information about assigning permissions to users, see Getting Started with Permissions
Generating an App API Key
- Click the user menu in the top right corner of Kion and select App API Keys.
- Click Add.
- Enter a name for your app API key.
- Click Create App API Key.
- Click anywhere in the App API Key field to copy the token to your clipboard.
Store this token in a secure location. You cannot view the token again after closing this modal.
You can now use this token to send requests via the Kion public API. The app API key must be added to a request header with a name of Authorization and a value in this format: Bearer YOURTOKENHERE
.
What Next?