Skip to content

Authentication with an API token

If you want to use the API from a server, then you need to provide a valid API token in order access the API. You can create an API token in Mediani admin interface settings menu on the user management tab.

Log in → Click "Käyttäjien hallinta" → Click edit button for user who you want to generate token → Input user password → Click "Luo"

Once you have obtained your API tokens, define the Authorization HTTP header for all your API requests:

Authorization: Token <api_key>

Curl example:

foo@bar:~$ curl -X GET https://mediani.fi/api/company/ -H 'Authorization: Token <api_key>'

Will return information of your company.

You should replace the with your API token.

API Token is always connected to some user and has same permissions as that user would have. You should always keep your tokens safe and give them the least amount of permissions that work for your use case.