# Alerts

This guide will help you fetch metrics and dimensions used to compile Smartsight Alerts dashboard. &#x20;

### AI Alerts <mark style="color:green;">GET</mark>  <a href="#plays" id="plays"></a>

Returns the AI alerts.&#x20;

{% code overflow="wrap" lineNumbers="true" %}

```bash
curl 'https://smartsight3.mediamelon.com/mm-apis/getAIAlerts/<customer-id>?planlevel=<level>&period=start=1729666800,end=1730271600'
-x GET --header 'Authorization: Bearer <access_token>'
```

{% endcode %}

{% hint style="info" %}
If you run this request yourself it will not work,  you should replace the \<access\_token> in this example with your own Keycloak access\_token you get by running [Fetch Auth Token](https://docs.mediamelon.com/mediamelon/smartsight-apis/accessing-the-api#auth-token)
{% endhint %}

#### Required request path parameters

<table data-view="cards"><thead><tr><th></th><th></th><th></th></tr></thead><tbody><tr><td><code>customer-id</code> string</td><td>A path parameter in form of a string. This is the unique identifier and you will be able to find this Id on your user profile page.</td><td></td></tr></tbody></table>

#### Required request query parameters

<table data-view="cards"><thead><tr><th></th><th></th><th></th></tr></thead><tbody><tr><td><code>planlevel</code>string</td><td>A  query parameter in form of a string. This is the plan identifier number associated with CustomerID and you will be able to find this plan level using https://smartsight.mediamelon.com/planLevelByCustId/&#x3C;customer-id></td><td></td></tr><tr><td><code>period</code> string</td><td>A query parameter in comma-separated string format. It needs to in the format of start date and end date (eg: start=1729666800,end=1730271600) in epoch time. For reference, use this <a href="https://www.epochconverter.com/">Epoch Time converter</a></td><td></td></tr></tbody></table>

#### Response

<details>

<summary><mark style="color:green;">GET</mark>  <mark style="background-color:green;">200</mark></summary>

{% code overflow="wrap" lineNumbers="true" %}

```json
[
    {
        "timestamp": 1727769181,
        "alertname": "BUFFERINGRATIO3",
        "qoename": "Buffering Ratio",
        "email_address": "vinayakd@mediamelon.com",
        "total_anomalies": 1,
        "starttime": 1727725976,
        "endtime": 1727769176,
        "totalsession": 300716,
        "totalaffectedsession": 7179,
        "anomalydate": "01-10-2024",
        "totalpages": 310
    },
    .
    ..
    ...
    ....
    .....
    {
        "timestamp": 1730233480,
        "alertname": "FATALERROR4",
        "qoename": "Fatal Errors",
        "email_address": "vinayakd@mediamelon.com",
        "total_anomalies": 1,
        "starttime": 1730190279,
        "endtime": 1730233479,
        "totalsession": 145606,
        "totalaffectedsession": 2328,
        "anomalydate": "29-10-2024",
        "totalpages": 310
    }
]
```

{% endcode %}

</details>
