How do I get an API key?

Currently, the preferred method for interacting with our API is through the use of an API key, especially for deployed solutions.

However, if you are in the testing phase and want a temporary solution, you can use a session token.

How to create a token using basic authorization?

We don't recommend using this method for a permanent solution but an alternative during testing. A good resource for a basic introduction to the technique is on Mozilla's web-docs HTTP Authorization page. This is a good starting point because it also mentions key information, including that authorization and encoding are not the same thing.

Once you have converted your username and password and added it correctly into your header, you will receive a response that includes the "token".

Using curl as an example (with the example user/password details - username:password):

curl -H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ='\
-X GET https://api.onomondo.com/token

and in response you will receive the payload:

{
"token": YOUR_TOKEN_VALUE,
"user_type":"user"
}

You can use Python's Request library, which even has a shorthand for basic authentication. Another option in NodeJS is the  axios package.

How do I get and use an API key?

If you have a solution that requires a fixed API key, write to us at support@onomondo.com with the email of the user you would like attached to the API key . We will activate it and that email will receive the key. 

The key needs to be in all API requests in the header parameter in the payload header.

For example, using curl:

curl -H 'Authorization: YOUR_API_KEY'\
-X GET https://api.onomondo.com/sims

You can also find this information in our API Documentation. If you have any questions, send us an email at support@onomondo.com and we will help you out.