API and API keys
Trail has an open interface that allows other systems to read and write resources to Trail. The documentation for the open interface can be seen here: https://apidoc.trail.fi/
An interface key (API Token/Key) is required to access the interface.
To enable API keys in the system, please contact Trail Support: support@trail.fi and Trail Support will activate the API keys section under the Administration module. Please make sure you have access to the Administration module to see the API Keys section:
To create a new API key:
Go to the Admin module and from there select API keys. You will be taken to the API keys page, where you can see the existing API keys or you can create a new API key by clicking on the 'Create' button:
After clicking on the 'Create' button, you will see the 'Create a new API key' form below:
You can give an API key a name and write a description for it. When creating a new API key, give the API key a validity period. The validity period tells you how long the API key is valid. You also need to define departments for the API key. This means that this API key can only access these specified departments, even if the user has access to all departments otherwise.
When creating an API key, be sure to give the API key rights to the different modules. These rights granted apply only to the API key:
More about rights in the 'User rights explained' article: https://help.trail.fi/article/163-user-rights-explained
Once you have given the API key a name, entered information in the description if you wish, given a validity period, selected departments, and given rights, be sure to click on the 'Create' button to allow the system to create the API key:
Once an API key has been created, you will see the list of keys created and their status, which is 'Inactivate':
You can then download the key, after download the key becomes active:
Now you can use the API key. In the API documentation, you can see the interface services, the call formats to the services, and the values returned by the interface.