# Getting Started

All Akinon API responses are formatted in JSON. API is served over HTTPS to ensure data privacy, unencrypted HTTP is not supported.

```code
Base URL : https://{omnitron_url}/api/i1/
```

`{omnitron_url}` is the domain name of a customer's Omnitron. For example, akinon.omnitron.net

Akinon Omnitron API and its other products use your Omnitron account for authentication. If you don't have an account yet, you can get in touch with a partner manager for [Akinon Omnitron Account](https://www.akinon.com/partner-program).

## <mark style="color:red;">API Authentication</mark>

All requests to Akinon's REST API need to be authenticated. To begin using the Akinon APIs, you will need to generate an API key with Login API. All other requests should be sent with the token response from the API key generated by Login API.

{% hint style="warning" %}
Make sure that Content-Type:application/json is in the header of each request.
{% endhint %}

| **Parameter** | **Data Type** | **Description**          |
| ------------- | ------------- | ------------------------ |
| `username`    | string        | Akinon Omnitron Username |
| `password`    | string        | Akinon Omnitron Password |

### <mark style="color:red;">Request POST</mark>

You need to issue an HTTPS POST to a login url in order to get an API key.

`Content_Type` header represents the response type.

Body requests must contain a `username` and a `password`.

```python
import requests
import json
url = "https://{customer_api_url}/api/i1/auth/login/"
headers = {
    'Content-Type': 'application/json'
}
data = {
    'username': 'Omnitron Username',
    'password': 'Omnitron Password'
}
response = requests.post(url, headers=headers, data=json.dumps(data))
print(response.text)
```

#### Response

The response returns an API key. This key is required to be used in other resources. The return key must be added in headers of any requests as `Authorization`: `Token {}`.format(api\_token).

```json
{
    "key": "f532eXXXXXXXXXXXXXXXXX201XXXXX9332d"
}
```

Resource Properties are in Python format:

| **Parameter** | **Data Type** | **Description**                     |
| ------------- | ------------- | ----------------------------------- |
| key           | string        | The API key of the customer account |
