# Errors

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

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

Returns the total errors for all the users .&#x20;

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

```bash
curl 'https://smartsight3.mediamelon.com/mm-apis/session/<customer-id>?planlevel=<level>&period=start=1729666800,end=1730271600&metrics=errors,subscriberid&agg=1&aggby=subscriberid'
-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><tr><td><code>metrics</code>string</td><td>Combination of query parameters <code>metrics=concurviewavg,users</code> in string format. This request needs comma-separated metrics to retrieve the rquested data. </td><td></td></tr><tr><td><code>agg</code> string </td><td>A  query parameter in form of a string to return data by enabling or disabling aggregation (values: 1 or 2).    </td><td></td></tr></tbody></table>

#### Response&#x20;

<details>

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

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

```json
{
    "totalcount": 1,
    "pagecount": 1,
    "totalrecords": 1,
    "response": [
        {
            "errors": 334330,
            "subscriberid": "xxxxxxx",
            "totalpages": 2
        }.......
    ]
}
```

{% endcode %}

</details>

***

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

Returns the error insights with classifications.&#x20;

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

```bash
curl 'https://smartsight3.mediamelon.com/mm-apis/session/<customer-id>?planlevel=<level>&period=start=1729666800,end=1730271600&metrics=category,key,errors,player&agg=1&aggby=category,key,player'
-x GET --header 'Authorization: Bearer <access_token>'
```

{% endcode %}

#### 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><tr><td><code>metrics</code>string</td><td>Combination of query parameters <code>metrics=category,key,errors,player</code> in string format. This request needs comma-separated metrics to retrieve the rquested data. </td><td></td></tr><tr><td><code>agg</code> string </td><td>A  query parameter in form of a string to return data by enabling or disabling aggregation (values: 1 or 2).    </td><td></td></tr><tr><td><code>aggby</code> string </td><td>Combinaton of query parameters<code>aggby=category,key,player</code> in string format. This request data will aggregated by given dimension query parameter.</td><td></td></tr></tbody></table>

#### Response&#x20;

<details>

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

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

```json
{
    "totalcount": 292,
    "pagecount": 292,
    "totalrecords": 292,
    "response": [
        {
            "category": "IN_STREAM_ERROR",
            "key": "NETWORK_HTTP50_ERROR",
            "errors": 2,
            "player": "svod-android-exoplayer",
            "totalpages": 292
        },
        {
            "category": "STARTUPFAILURE_ERROR",
            "key": "NETWORK_HTTP50_ERROR",
            "errors": 41,
            "player": "tve-firetv-exoplayer",
            "totalpages": 292
        },
        .
        ..
        ...
        ....
        .....
        ......
        {
            "category": "IN_STREAM_FATAL",
            "key": "PLAYBACK_ERROR",
            "errors": 3031,
            "player": "svod-ios-avplayer",
            "totalpages": 292
        }
    ]
}
```

{% endcode %}

</details>
