# Live Report Builder API

## /ams/reports/{id}/data

<mark style="color:blue;">`GET`</mark> `https://api.commander1.com/v2/{siteId}/ams/reports/{id}/data`

Returns data for each metric of the report. Metrics and attribution models are listed in the response in a columns array. Values are listed in a rows array. Each row has a type and a list of values for each metric. The type defines if the row describes the total of all values or a single value of the level.

#### Path Parameters

| Name | Type    | Description                           |
| ---- | ------- | ------------------------------------- |
| id   | integer | Repord ID (public id or technical id) |

#### Query Parameters

| Name    | Type    | Description                                                                                                                                                                                                                       |
| ------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| token   | string  | Authentication token. Optional if the query parameter is used instead.                                                                                                                                                            |
| levels  | array   | <p>To specify the values of the parent levels.<br>Send value for each <strong>level\_id</strong> (<strong>1</strong> and <strong>2</strong> in examples below).<br>Ex: levels\[1]=SEA\&levels\[2]=generic</p>                     |
| filters | array   | <p>To specify the values of the filters.<br>Send value(s) for each <strong>filter\_id</strong> (<strong>1</strong> and <strong>2</strong> in examples below).<br>Ex: filters\[1]\[]=fr\&filters\[1]\[]=it\&filters\[2]\[]=tab</p> |
| date    | boolean | <p><br>To specify the range period. Default is the last three months. The use of ISO 8601 standard is strongly recommended. Ex: date\[start]=2020-11-30T23:00:00.000Z\&date\[end]=2020-12-31T22:59:59.999Z<br></p>                |

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

```javascript
{
  "data": {
    "columns": [
      "name",
      "metric-1",
      "metric-3",
      "attribution-model-1_metric-5",
      "attribution-model-1_metric-12",
      "attribution-model-2_metric-5",
      "attribution-model-2_metric-12"
    ],
    "rows": [
      {
        "name": {
          "type": "string",
          "value": "Criteo"
        },
        "metric-1": {
          "type": "number",
          "value": "4719671"
        },
        "metric-3": {
          "type": "number",
          "value": "1657901"
        },
        "attribution-model-1_metric-5": {
          "type": "number",
          "value": "21739964"
        },
        "attribution-model-1_metric-12": {
          "type": "ratio",
          "value": "29.47"
        },
        "attribution-model-2_metric-5": {
          "type": "number",
          "value": "25549890"
        },
        "attribution-model-2_metric-12": {
          "type": "ratio",
          "value": "47.45"
        }
      },
      {
        "name": {
          "type": "string",
          "value": "zanox"
        },
        "metric-1": {
          "type": "number",
          "value": "80592"
        },
        "metric-3": {
          "type": "number",
          "value": "19668"
        },
        "attribution-model-1_metric-5": {
          "type": "number",
          "value": "7122"
        },
        "attribution-model-1_metric-12": {
          "type": "ratio",
          "value": "70.53"
        },
        "attribution-model-2_metric-5": {
          "type": "number",
          "value": "39127"
        },
        "attribution-model-2_metric-12": {
          "type": "ratio",
          "value": "58.89"
        }
      }
    ],
    "total": {
      "name": {
        "type": "string",
        "value": "Criteo"
      },
      "metric-1": {
        "type": "number",
        "value": "4800263"
      },
      "metric-3": {
        "type": "number",
        "value": "1677569"
      },
      "attribution-model-1_metric-5": {
        "type": "number",
        "value": "21747086"
      },
      "attribution-model-1_metric-12": {
        "type": "ratio",
        "value": "100.00"
      },
      "attribution-model-2_metric-5": {
        "type": "number",
        "value": "25589017"
      },
      "attribution-model-2_metric-12": {
        "type": "ratio",
        "value": "100.00"
      }
    }
  },
  "meta": {
    "pagination": {
      "total": 72,
      "count": 50,
      "per_page": 50,
      "current_page": 1,
      "total_pages": 2
    }
  },
  "links": {
    "self": "https://api.commander1.com/v2/ams/reports?page=1",
    "first": "https://api.commander1.com/v2/ams/reports?page=1",
    "next": "https://api.commander1.com/v2/ams/reports?page=2",
    "last": "https://api.commander1.com/v2/ams/reports?page=2"
  }
}
```

{% endtab %}

{% tab title="404 Report not found" %}

```
```

{% endtab %}
{% endtabs %}

&#x20;This API uses [JSON API](http://jsonapi.org/) to fetch, create and modify the resources, and to format responses.\
Authentication and information exchange are ensured with [JSON WEB TOKEN](https://jwt.io/).

## How to get the token

For each API, you'll have to ask a token to your account manager or support team.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://community.commandersact.com/mixcommander/api/live-report-builder.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
