# DashboardsWidgetsApi

All URIs are relative to *https://admin-api.connected.dev*

|Method | HTTP request | Description|
|------------- | ------------- | -------------|
|[**createDashboardWidget**](#createdashboardwidget) | **POST** /dashboards/{dashboardId}/widgets | Add a widget to a dashboard|
|[**deleteDashboardWidget**](#deletedashboardwidget) | **DELETE** /dashboards/{dashboardId}/widgets/{widgetId} | Remove a widget from a dashboard|
|[**getDashboardWidgets**](#getdashboardwidgets) | **GET** /dashboard/{dashboardId}/widgets | List widgets available for a dashboard|
|[**updateDashboardWidget**](#updatedashboardwidget) | **PUT** /dashboards/{dashboardId}/widgets/{widgetId} | Update a dashboard widget|

# **createDashboardWidget**
> CreateDashboardWidget200Response createDashboardWidget(dashboardWidgetCreateInputs)

Creates a new widget on a dashboard using a specified analytics endpoint and widget configuration, and requires update permission on dashboards.

### Example

```typescript
import {
    DashboardsWidgetsApi,
    Configuration,
    DashboardWidgetCreateInputs
} from '@connectedxm/admin-sdk';

const configuration = new Configuration();
const apiInstance = new DashboardsWidgetsApi(configuration);

let dashboardId: string; //The dashboard identifier (default to undefined)
let dashboardWidgetCreateInputs: DashboardWidgetCreateInputs; //

const { status, data } = await apiInstance.createDashboardWidget(
    dashboardId,
    dashboardWidgetCreateInputs
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **dashboardWidgetCreateInputs** | **DashboardWidgetCreateInputs**|  | |
| **dashboardId** | [**string**] | The dashboard identifier | defaults to undefined|


### Return type

**CreateDashboardWidget200Response**

### Authorization

[ApiKeyAuth](../README.md#ApiKeyAuth), [OrganizationId](../README.md#OrganizationId)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | Successful response |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **deleteDashboardWidget**
> SyncAccounts200Response deleteDashboardWidget()

Permanently deletes a single widget from a dashboard, and requires update permission on dashboards.

### Example

```typescript
import {
    DashboardsWidgetsApi,
    Configuration
} from '@connectedxm/admin-sdk';

const configuration = new Configuration();
const apiInstance = new DashboardsWidgetsApi(configuration);

let dashboardId: string; //The dashboard identifier (default to undefined)
let widgetId: string; //The widget identifier (default to undefined)

const { status, data } = await apiInstance.deleteDashboardWidget(
    dashboardId,
    widgetId
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **dashboardId** | [**string**] | The dashboard identifier | defaults to undefined|
| **widgetId** | [**string**] | The widget identifier | defaults to undefined|


### Return type

**SyncAccounts200Response**

### Authorization

[ApiKeyAuth](../README.md#ApiKeyAuth), [OrganizationId](../README.md#OrganizationId)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | Successful response |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **getDashboardWidgets**
> GetDashboardWidgets200Response getDashboardWidgets()

Returns the analytics widgets that can be added to the given dashboard, scoped to event or session widgets for event dashboards and organization widgets otherwise, optionally filtered by widget type; requires read permission on dashboards.

### Example

```typescript
import {
    DashboardsWidgetsApi,
    Configuration
} from '@connectedxm/admin-sdk';

const configuration = new Configuration();
const apiInstance = new DashboardsWidgetsApi(configuration);

let dashboardId: string; //The dashboard identifier (default to undefined)
let type: string; //Filter by type (optional) (default to undefined)

const { status, data } = await apiInstance.getDashboardWidgets(
    dashboardId,
    type
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **dashboardId** | [**string**] | The dashboard identifier | defaults to undefined|
| **type** | [**string**] | Filter by type | (optional) defaults to undefined|


### Return type

**GetDashboardWidgets200Response**

### Authorization

[ApiKeyAuth](../README.md#ApiKeyAuth), [OrganizationId](../README.md#OrganizationId)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | Successful response |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **updateDashboardWidget**
> CreateDashboardWidget200Response updateDashboardWidget(dashboardWidgetUpdateInputs)

Updates the configuration of an existing widget on a dashboard, such as its layout, title, or settings, and requires update permission on dashboards.

### Example

```typescript
import {
    DashboardsWidgetsApi,
    Configuration,
    DashboardWidgetUpdateInputs
} from '@connectedxm/admin-sdk';

const configuration = new Configuration();
const apiInstance = new DashboardsWidgetsApi(configuration);

let dashboardId: string; //The dashboard identifier (default to undefined)
let widgetId: string; //The widget identifier (default to undefined)
let dashboardWidgetUpdateInputs: DashboardWidgetUpdateInputs; //

const { status, data } = await apiInstance.updateDashboardWidget(
    dashboardId,
    widgetId,
    dashboardWidgetUpdateInputs
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **dashboardWidgetUpdateInputs** | **DashboardWidgetUpdateInputs**|  | |
| **dashboardId** | [**string**] | The dashboard identifier | defaults to undefined|
| **widgetId** | [**string**] | The widget identifier | defaults to undefined|


### Return type

**CreateDashboardWidget200Response**

### Authorization

[ApiKeyAuth](../README.md#ApiKeyAuth), [OrganizationId](../README.md#OrganizationId)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | Successful response |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

