# AdvertisementsApi

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

|Method | HTTP request | Description|
|------------- | ------------- | -------------|
|[**createAdvertisement**](#createadvertisement) | **POST** /advertisements | Create an advertisement|
|[**deleteAdvertisement**](#deleteadvertisement) | **DELETE** /advertisements/{advertisementId} | Delete an advertisement|
|[**getAdvertisement**](#getadvertisement) | **GET** /advertisements/{advertisementId} | Get a single advertisement|
|[**getAdvertisementClicks**](#getadvertisementclicks) | **GET** /advertisements/{advertisementId}/clicks | List an advertisement\&#39;s clicks|
|[**getAdvertisementViews**](#getadvertisementviews) | **GET** /advertisements/{advertisementId}/views | List an advertisement\&#39;s view records|
|[**getAdvertisements**](#getadvertisements) | **GET** /advertisements | List advertisements|
|[**updateAdvertisement**](#updateadvertisement) | **PUT** /advertisements/{advertisementId} | Update an advertisement|

# **createAdvertisement**
> CreateAdvertisement200Response createAdvertisement(advertisementCreateInputs)

Creates a new advertisement record for the organization from the given details; requires create permission on advertisements.

### Example

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

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

let advertisementCreateInputs: AdvertisementCreateInputs; //

const { status, data } = await apiInstance.createAdvertisement(
    advertisementCreateInputs
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **advertisementCreateInputs** | **AdvertisementCreateInputs**|  | |


### Return type

**CreateAdvertisement200Response**

### 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)

# **deleteAdvertisement**
> CreateAccountInvitations200Response deleteAdvertisement()

Permanently deletes the specified advertisement from the organization; requires delete permission on advertisements.

### Example

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

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

let advertisementId: string; //The advertisement identifier (default to undefined)

const { status, data } = await apiInstance.deleteAdvertisement(
    advertisementId
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **advertisementId** | [**string**] | The advertisement identifier | defaults to undefined|


### Return type

**CreateAccountInvitations200Response**

### 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)

# **getAdvertisement**
> CreateAdvertisement200Response getAdvertisement()

Retrieves the details of a single advertisement by its advertisementId, requiring read permission on advertisements.

### Example

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

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

let advertisementId: string; //The advertisement identifier (default to undefined)

const { status, data } = await apiInstance.getAdvertisement(
    advertisementId
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **advertisementId** | [**string**] | The advertisement identifier | defaults to undefined|


### Return type

**CreateAdvertisement200Response**

### 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)

# **getAdvertisementClicks**
> GetAdvertisementClicks200Response getAdvertisementClicks()

Returns a paginated list of click events recorded for the specified advertisement, supporting search and ordering, and requiring read permission on advertisements.

### Example

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

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

let advertisementId: string; //The advertisement identifier (default to undefined)
let page: number; //Page number (optional) (default to 1)
let pageSize: number; //Number of items per page (optional) (default to 25)
let orderBy: string; //Field to order by (optional) (default to undefined)
let search: string; //Search query (optional) (default to undefined)

const { status, data } = await apiInstance.getAdvertisementClicks(
    advertisementId,
    page,
    pageSize,
    orderBy,
    search
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **advertisementId** | [**string**] | The advertisement identifier | defaults to undefined|
| **page** | [**number**] | Page number | (optional) defaults to 1|
| **pageSize** | [**number**] | Number of items per page | (optional) defaults to 25|
| **orderBy** | [**string**] | Field to order by | (optional) defaults to undefined|
| **search** | [**string**] | Search query | (optional) defaults to undefined|


### Return type

**GetAdvertisementClicks200Response**

### 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)

# **getAdvertisementViews**
> GetAdvertisementViews200Response getAdvertisementViews()

Returns a paginated list of view (impression) records for the given advertisement, supporting search and ordering; requires read permission on advertisements.

### Example

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

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

let advertisementId: string; //The advertisement identifier (default to undefined)
let page: number; //Page number (optional) (default to 1)
let pageSize: number; //Number of items per page (optional) (default to 25)
let orderBy: string; //Field to order by (optional) (default to undefined)
let search: string; //Search query (optional) (default to undefined)

const { status, data } = await apiInstance.getAdvertisementViews(
    advertisementId,
    page,
    pageSize,
    orderBy,
    search
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **advertisementId** | [**string**] | The advertisement identifier | defaults to undefined|
| **page** | [**number**] | Page number | (optional) defaults to 1|
| **pageSize** | [**number**] | Number of items per page | (optional) defaults to 25|
| **orderBy** | [**string**] | Field to order by | (optional) defaults to undefined|
| **search** | [**string**] | Search query | (optional) defaults to undefined|


### Return type

**GetAdvertisementViews200Response**

### 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)

# **getAdvertisements**
> GetAdvertisements200Response getAdvertisements()

Returns a paginated list of advertisements for the organization, optionally filtered by accountId, supporting search and ordering, and requiring read permission on advertisements.

### Example

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

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

let accountId: string; //Filter by accountId (optional) (default to undefined)
let page: number; //Page number (optional) (default to 1)
let pageSize: number; //Number of items per page (optional) (default to 25)
let orderBy: string; //Field to order by (optional) (default to undefined)
let search: string; //Search query (optional) (default to undefined)

const { status, data } = await apiInstance.getAdvertisements(
    accountId,
    page,
    pageSize,
    orderBy,
    search
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **accountId** | [**string**] | Filter by accountId | (optional) defaults to undefined|
| **page** | [**number**] | Page number | (optional) defaults to 1|
| **pageSize** | [**number**] | Number of items per page | (optional) defaults to 25|
| **orderBy** | [**string**] | Field to order by | (optional) defaults to undefined|
| **search** | [**string**] | Search query | (optional) defaults to undefined|


### Return type

**GetAdvertisements200Response**

### 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)

# **updateAdvertisement**
> CreateAdvertisement200Response updateAdvertisement(advertisementUpdateInputs)

Updates the details of an existing advertisement identified by advertisementId; requires update permission on advertisements.

### Example

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

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

let advertisementId: string; //The advertisement identifier (default to undefined)
let advertisementUpdateInputs: AdvertisementUpdateInputs; //

const { status, data } = await apiInstance.updateAdvertisement(
    advertisementId,
    advertisementUpdateInputs
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **advertisementUpdateInputs** | **AdvertisementUpdateInputs**|  | |
| **advertisementId** | [**string**] | The advertisement identifier | defaults to undefined|


### Return type

**CreateAdvertisement200Response**

### 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)

