# Sensors

{% hint style="warning" %}
Fields with \* are required.
{% endhint %}

## Getting sensors

## Get sensors.

<mark style="color:blue;">`GET`</mark> `https://api.control.serenicity.fr/api/v1/sensors`

Return the list of your sensors.

{% tabs %}
{% tab title="200" %}

```json
[
    {
        "id": 54,
        "type_fk": "DETOXIO",
        "name": "Labo Debian Buster",
        "mac_address": "00:11:22:e1:a2:26",
        "public_ip": "1.1.1.1",
        "local_ip": "192.168.1.186",
        "installation_date": "2022-04-22T08:54:50.778Z",
        "supervision": true,
        "filtering": true,
        "version": "D3.0.0",
        "end_trial": "2022-06-20T22:00:00.000Z",
        "status": "CONNECTED",
        "hno_hours": [
            21,
            22,
            23,
            0,
            1,
            2,
            3,
            4,
            5,
            6
        ],
        "timezone": "Europe/Paris",
        "latitude": 42.12345678912345,
        "longitude": 5.12345678912345,
        "full_name": "DETOXIO Labo Debian Buster",
        "current_cyt": 100
    }
]
```

{% endtab %}
{% endtabs %}

## Getting a specific sensor

## Get sensor.

<mark style="color:blue;">`GET`</mark> `https://api.control.serenicity.fr/api/v1/sensors/:sensor_id`

Return one of your sensors.

#### Path Parameters

| Name                                         | Type    | Description |
| -------------------------------------------- | ------- | ----------- |
| sensor\_id<mark style="color:red;">\*</mark> | Integer |             |

{% tabs %}
{% tab title="200" %}

```json
{
    "id": 54,
    "type_fk": "DETOXIO",
    "name": "Labo Debian Buster",
    "mac_address": "00:11:22:e1:a2:26",
    "public_ip": "1.1.1.1",
    "local_ip": "192.168.1.186",
    "installation_date": "2022-04-22T08:54:50.778Z",
    "supervision": true,
    "filtering": true,
    "version": "D3.0.0",
    "end_trial": "2022-06-20T22:00:00.000Z",
    "status": "CONNECTED",
    "hno_hours": [
        21,
        22,
        23,
        0,
        1,
        2,
        3,
        4,
        5,
        6
    ],
    "timezone": "Europe/Paris",
    "latitude": 42.12345678912345,
    "longitude": 5.12345678912345,
    "full_name": "DETOXIO Labo Debian Buster",
    "current_cyt": 100
}
```

{% endtab %}

{% tab title="404" %}

```json
{
    "errors": [
        {
            "message": "Resource not found."
        }
    ]
}
```

{% endtab %}
{% endtabs %}

## Getting statistics

The statistics metrics are grouped by month for each sensor.&#x20;

The `start_of_month_tz` field represents the start time of the month at the local time of the sensor (defined by the site's time zone).

## Get sensor statistics.

<mark style="color:blue;">`GET`</mark> `https://api.control.serenicity.fr/api/v1/sensors/:sensor_id/statistics`

Return the statistics for one of your sensors.

#### Path Parameters

| Name                                         | Type   | Description |
| -------------------------------------------- | ------ | ----------- |
| sensor\_id<mark style="color:red;">\*</mark> | String |             |

{% tabs %}
{% tab title="200" %}

```javascript
[
    {
        "sensor_id": 54,
        "in_flux": "321731521265",
        "out_flux": "19580273143",
        "toxic_in_flux": "161541",
        "toxic_out_flux": "48919",
        "in_count": "200",
        "out_count": "113036",
        "toxic_in_count": "883",
        "toxic_out_count": "9",
        "cyt": "325",
        "toxic_count": "307",
        "bruteforce_count": "219",
        "command_center_count": "14",
        "hcard_count": "1",
        "military_count": "0",
        "tor_node_count": "2",
        "trojan_count": "0",
        "sip_count": "1",
        "video_count": "0",
        "supply_chain_compromise_count": "0",
        "start_of_month": "2024-06-30T22:00:00.000Z"
    }
]
```

{% endtab %}

{% tab title="404" %}

```javascript
{
    "errors": [
        {
            "message": "Resource not found."
        }
    ]
}
```

{% endtab %}
{% endtabs %}
