> ## Documentation Index
> Fetch the complete documentation index at: https://koreai.mintlify.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Dashboard Widget Data

<Badge icon="arrow-left" color="gray">[Back to API List](/ai-for-service/apis/automation/api-list)</Badge>

Retrieves data associated with custom widgets and reports for a bot.

| **Method**        | GET / POST                                                                                                                                                |
| ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Endpoint**      | `https://{{host}}/api/public/bot/{{BotID}}/dashboard/{{dashboardName}}/widget/{{widgetName}}?startDate={{startDate}}&endDate={{endDate}}&limit={{limit}}` |
| **Content Type**  | `application/json`                                                                                                                                        |
| **Authorization** | `auth: {{JWT}}` See [How to generate the JWT Token.](/ai-for-service/apis/automation/api-introduction/#generating-the-jwt-token)                          |
| **API Scope**     | App Builder: Custom Reports; Admin Console: Custom Reports > Custom Reports                                                                               |

<Note>
  A POST API call is supported to include additional filters for querying data. See [Custom Dashboard Filters](/ai-for-service/analytics/automation/custom-dashboard/create-custom-dashboard-filters) for more information.
</Note>

## Path Parameters

| **Parameter** | **Required/Optional** | **Description**                                                            |
| ------------- | --------------------- | -------------------------------------------------------------------------- |
| `host`        | Required              | Environment URL, for example, `https://platform.kore.ai`                   |
| `BotID`       | Required              | Bot ID or Stream ID. Accessible from the General Settings page of the bot. |

## Sample Request for GET Call

```json theme={null}
curl -X GET \
 "https://{{host}}/api/public/bot/{{bot_id}}/dashboard/{{dashboardName}}/widget/{{widgetName}}?startDate={{startDate}}&endDate={{endDate}}" \
  -H 'auth: {{YOUR_JWT_ACCESS_TOKEN}}' \
  -H 'content-type: application/json'
```

## Sample Request for POST Call

```json theme={null}
curl --location --request POST 'https://{{host}}/api/public/bot/{{bot_id}}/dashboard/{{dashboardName}}/widget/{{widgetName}}?startDate={{startDate}}&endDate={{endDate}}' \
--header 'auth: {{YOUR_JWT_ACCESS_TOKEN}}' \
--header 'Content-Type: application/json' \
--data-raw '{ "customFilters": [{
   "filterSource": "userType",
   "fieldName": "user",
   "values": [ "newuser" ]
}]
}'
```

## Body Parameters

| **Parameter**                                     | **Required/Optional** | **Description**                                                                                                                                                         |
| ------------------------------------------------- | --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `dashboardName`                                   | Required              | Name of the Custom Dashboard containing the required widget.                                                                                                            |
| `widgetName`                                      | Required              | Name of the widget whose data to retrieve.                                                                                                                              |
| `limit`                                           | Optional              | Number of records to fetch. Maximum is `50`.                                                                                                                            |
| `startDate`                                       | Required              | Start date for the data range. Use ISO date format (for example, `2020-03-30`).                                                                                         |
| `endDate`                                         | Required              | End date for the data range. Use ISO date format (for example, `2020-03-30`).                                                                                           |
| `customFilters` (filterSource, fieldName, values) | Required              | Additional filters for custom dashboards. See [Create Custom Dashboard Filters](/ai-for-service/analytics/automation/custom-dashboard/create-custom-dashboard-filters). |

## Sample Response for GET and POST Calls

```json theme={null}
{
    "_id": "wg-xxxx-xxx-xxx-xxx-xxxxx",
    "overlay": [],
    "name": "dasaDSA",
    "type": "table",
    "sqlQuery": {
        "dataSet": "Analytics",
        "select": "metricType",
        "startDate": "2019-08-31T18:30:00.000Z",
        "endDate": "2019-10-01T18:30:00.000Z",
        "botId": "st-xxxxx-xxx-xxx-xxx-xxxxx"
    },
    "dimensions": [
           {
            "fieldName": "metricType",
            "displayName": "metricType",
            "type": "string"
        }
    ],
    "metrics": [],
    "row": [],
    "properties": {},
    "queryResponse": {
        "metaData": {
            "metricType": "string"
        },
        "queryResponse": [
            {
                "metricType": "successintents"
            },
            {
                "metricType": "successtasks"
            },
            {
                "metricType": "successintents"
            },
            {
                "metricType": "successintents"
            },
            {
                "metricType": "successtasks"
            },
            {
                "metricType": "failedintents"
            }
        ]
    }
}
```
