diff --git a/CHANGELOG.md b/CHANGELOG.md index ff81482..6941e60 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ # Changelog All changes to this project will be documented in this file. +## [2.6.7] - 2024-11-04 +- Analytics updates (ccv, views, ...) + ## [2.6.6] - 2024-10-21 - Add summary feature diff --git a/docs/api/AnalyticsApi.md b/docs/api/AnalyticsApi.md index 399b8da..f3bd618 100644 --- a/docs/api/AnalyticsApi.md +++ b/docs/api/AnalyticsApi.md @@ -19,11 +19,13 @@ Retrieve time-based and countable metrics like average watch time or the number | Name | Type | Required | Description | | ------------- | ------------- | ------------- | ------------- | - | **metric** | **'play' \| 'start' \| 'end' \| 'impression' \| 'impression-time' \| 'watch-time'**| **yes**| Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. You can use the aggregations `count`, `rate`, and `total` with the `play` metric. - `start` is the number of times playback was started. You can use the aggregation `count` with this metric. - `end` is the number of times playback has ended with the content watch until the end. You can use the aggregation `count` with this metric. - `impression` is the number of times your content has been loaded and was ready for playback. You can use the aggregation `count` with this metric. - `impression-time` is the time in milliseconds that your content was loading for until the first video frame is displayed. You can use the aggregations `average` and `sum` with this metric. - `watch-time` is the cumulative time in seconds that the user has spent watching your content. You can use the aggregations `average` and `sum` with this metric. | - | **aggregation** | **'count' \| 'rate' \| 'total' \| 'average' \| 'sum'**| **yes**| Use this path parameter to define a way of collecting data for the metric that you want analytics for. - `count` returns the overall number of events for the `play` metric. - `rate` returns the ratio that calculates the number of plays your content receives divided by its impressions. This aggregation can be used only with the `play` metric. - `total` calculates the total number of events for the `play` metric. - `average` calculates an average value for the selected metric. - `sum` adds up the total value of the select metric. | + | **metric** | **'play' \| 'start' \| 'end' \| 'impression' \| 'impression-time' \| 'watch-time' \| 'ccv' \| 'view'**| **yes**| Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. You can use the aggregations `count`, `rate`, and `total` with the `play` metric. - `start` is the number of times playback was started. You can use the aggregation `count` with this metric. - `end` is the number of times playback has ended with the content watch until the end. You can use the aggregation `count` with this metric. - `impression` is the number of times your content has been loaded and was ready for playback. You can use the aggregation `count` with this metric. - `impression-time` is the time in milliseconds that your content was loading for until the first video frame is displayed. You can use the aggregations `average` and `sum` with this metric. - `watch-time` is the cumulative time in seconds that the user has spent watching your content. You can use the aggregations `average` and `sum` with this metric. - `ccv`: is the number of concurrent viewers, or users watching at the same time. - `view`: the total number of viewers until this point in time. | + | **aggregation** | **'count' \| 'rate' \| 'total' \| 'average' \| 'sum' \| 'peak' \| 'live'**| **yes**| Use this path parameter to define a way of collecting data for the metric that you want analytics for. - `count` returns the overall number of events for the `play` metric. - `rate` returns the ratio that calculates the number of plays your content receives divided by its impressions. This aggregation can be used only with the `play` metric. - `total` calculates the total number of events for the `play` metric. - `average` calculates an average value for the selected metric. - `sum` adds up the total value of the select metric. - `peak` shows the highest value of the `ccv` metric in the timeframe of your request. You can use this aggregation only with the `ccv` metric. - `live` shows the highest value of the `ccv` metric from the last 20 seconds. You can use this aggregation only with the `ccv` metric. | | **from** | **Date**| no| Use this query parameter to define the starting date-time of the period you want analytics for. - If you do not set a value for `from`, the default assigned value is 1 day ago, based on the `to` parameter. - The maximum value is 30 days ago. - The value you provide should follow the ATOM date-time format: `2024-02-05T00:00:00+01:00` - The API ignores this parameter when you call `/data/metrics/play/total`. | | **to** | **Date**| no| Use this query parameter to define the ending date-time of the period you want analytics for. - If you do not set a value for `to`, the default assigned value is `now`. - The API ignores this parameter when you call `/data/metrics/play/total`. - The value for `to` is a non-inclusive value: the API returns data **before** the date-time that you set. | - | **filterBy** | [**FilterBy2**](../model/.md)| no| Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. - The API only accepts the `mediaId` and `mediaType` filters when you call `/data/metrics/play/total` or `/data/buckets/play-total/media-id`. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `EU`. Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `FR`. - `deviceType`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. - `tag`: Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). | + | **unique** | **boolean**| no| Use this query parameter to control how viewer data is counted: - `true` means that a single user watchig multiple times counts as 1 unique viewer - `false` means that all views count, even if from the same user. The API accepts this parameter only when you use the `ccv-peak`, `ccv-average`, or `view` metric. Viewers are unique for 1 day. The API determines uniqueness based on a viewer's `user-agent` and IP address. This means that the API can filter viewers using multiple tabs to watch the same video multiple times, but cannot filter for viewers who use multiple browsers to watch the same content multiple times. | + | **viewDuration** | **'3s' \| '5s' \| '10s' \| '30s'**| no| Use this query parameter to define how many seconds a view has to last to be counted in analytics data. - You can only use this parameter together with the `view` metric. - The accepted values are `3s`, `5s`, `10s`, and `30s`. - If you do not set this parameter, the API defaults to `5s`. | + | **filterBy** | [**FilterBy2**](../model/.md)| no| Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. - The API only accepts the `mediaId` and `mediaType` filters when you call `/data/metrics/play/total` or `/data/buckets/play-total/media-id`. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `EU`. Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `FR`. - `deviceType`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. - `tag`: Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). - `referrer`: Filters data based on the URL where the view is originating from. Accepts an empty string as a value to filter view events where no referrer is available. | ### Return type @@ -45,13 +47,15 @@ Retrieve detailed analytics play-rate and number of impressions segmented by dim | Name | Type | Required | Description | | ------------- | ------------- | ------------- | ------------- | - | **metric** | **'play' \| 'play-rate' \| 'play-total' \| 'start' \| 'end' \| 'impression'**| **yes**| Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. - `play-rate` is the ratio that calculates the number of plays your content receives divided by its impressions. - `play-total` is the total number of times a specific content has been played. You can only use the `media-id` breakdown with this metric. - `start` is the number of times playback was started. - `end` is the number of times playback has ended with the content watch until the end. - `impression` is the number of times your content has been loaded and was ready for playback. | - | **breakdown** | **'media-id' \| 'media-type' \| 'continent' \| 'country' \| 'device-type' \| 'operating-system' \| 'browser'**| **yes**| Use this path parameter to define a dimension for segmenting analytics data. You must use `kebab-case` for path parameters. These are the available dimensions: - `media-id`: Returns analytics based on the unique identifiers of a video or a live stream. - `media-type`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `device-type`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operating-system`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. | + | **metric** | **'play' \| 'play-rate' \| 'play-total' \| 'start' \| 'end' \| 'impression' \| 'ccv-peak' \| 'ccv-average' \| 'view'**| **yes**| Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. - `play-rate` is the ratio that calculates the number of plays your content receives divided by its impressions. - `play-total` is the total number of times a specific content has been played. You can only use the `media-id` breakdown with this metric. - `start` is the number of times playback was started. - `end` is the number of times playback has ended with the content watch until the end. - `impression` is the number of times your content has been loaded and was ready for playback. - `ccv-peak` is the highest number of concurrent viewers in the timeframe of your request. - `ccv-average` is the average number of concurrent viewers in the timeframe of your request. - `view` is the total number of viewers until this point in time. | + | **breakdown** | **'media-id' \| 'media-type' \| 'continent' \| 'country' \| 'device-type' \| 'operating-system' \| 'browser' \| 'referrer'**| **yes**| Use this path parameter to define a dimension for segmenting analytics data. You must use `kebab-case` for path parameters. These are the available dimensions: - `media-id`: Returns analytics based on the unique identifiers of a video or a live stream. - `media-type`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `device-type`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operating-system`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. - `referrer`: Returns the URL where the view originates from, for example a website where the video is embedded. View events from Android and iOS return empty strings as referrer. | | **from** | **Date**| no| Use this query parameter to define the starting date-time of the period you want analytics for. - If you do not set a value for `from`, the default assigned value is 1 day ago, based on the `to` parameter. - The maximum value is 30 days ago. - The value you provide should follow the ATOM date-time format: `2024-02-05T00:00:00+01:00` | | **to** | **Date**| no| Use this query parameter to define the ending date-time of the period you want analytics for. - If you do not set a value for `to`, the default assigned value is `now`. - The value for `to` is a non-inclusive value: the API returns data **before** the date-time that you set. | | **sortBy** | **'metricValue' \| 'dimensionValue'**| no| Use this parameter to choose which field the API will use to sort the analytics data. These are the available fields to sort by: - `metricValue`: Sorts the results based on the **metric** you selected in your request. - `dimensionValue`: Sorts the results based on the **dimension** you selected in your request. | | **sortOrder** | **'asc' \| 'desc'**| no| Use this parameter to define the sort order of results. These are the available sort orders: - `asc`: Sorts the results in ascending order: `A to Z` and `0 to 9`. - `desc`: Sorts the results in descending order: `Z to A` and `9 to 0`. | - | **filterBy** | [**FilterBy2**](../model/.md)| no| Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. - The API only accepts the `mediaId` and `mediaType` filters when you call `/data/metrics/play/total` or `/data/buckets/play-total/media-id`. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `EU`. Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `FR`. - `deviceType`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. - `tag`: Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). | + | **unique** | **boolean**| no| Use this query parameter to control how viewer data is counted: - `true` means that a single user watchig multiple times counts as 1 unique viewer - `false` means that all views count, even if from the same user. The API accepts this parameter only when you use the `ccv-peak`, `ccv-average`, or `view` metric. Viewers are unique for 1 day. The API determines uniqueness based on a viewer's `user-agent` and IP address. This means that the API can filter viewers using multiple tabs to watch the same video multiple times, but cannot filter for viewers who use multiple browsers to watch the same content multiple times. | + | **viewDuration** | **'3s' \| '5s' \| '10s' \| '30s'**| no| Use this query parameter to define how many seconds a view has to last to be counted in analytics data. - You can only use this parameter together with the `view` metric. - The accepted values are `3s`, `5s`, `10s`, and `30s`. - If you do not set this parameter, the API defaults to `5s`. | + | **filterBy** | [**FilterBy2**](../model/.md)| no| Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. - The API only accepts the `mediaId` and `mediaType` filters when you call `/data/metrics/play/total` or `/data/buckets/play-total/media-id`. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `EU`. Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `FR`. - `deviceType`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. - `tag`: Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). - `referrer`: Filters data based on the URL where the view is originating from. Accepts an empty string as a value to filter view events where no referrer is available. | | **currentPage** | **number**| no| Choose the number of search results to return per page. Minimum value: 1 | | **pageSize** | **number**| no| Results per page. Allowed values 1-100, default is 25. | @@ -75,13 +79,15 @@ Retrieve countable metrics like the number of plays or impressions, grouped by t | Name | Type | Required | Description | | ------------- | ------------- | ------------- | ------------- | - | **metric** | **'play' \| 'play-rate' \| 'start' \| 'end' \| 'impression'**| **yes**| Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. - `play-rate` is the ratio that calculates the number of plays your content receives divided by its impressions. - `start` is the number of times playback was started. - `end` is the number of times playback has ended with the content watch until the end. - `impression` is the number of times your content has been loaded and was ready for playback. | + | **metric** | **'play' \| 'play-rate' \| 'start' \| 'end' \| 'impression' \| 'ccv-peak' \| 'ccv-average' \| 'view'**| **yes**| Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. - `play-rate` is the ratio that calculates the number of plays your content receives divided by its impressions. - `start` is the number of times playback was started. - `end` is the number of times playback has ended with the content watch until the end. - `impression` is the number of times your content has been loaded and was ready for playback. - `ccv-peak` is the highest number of concurrent viewers in the timeframe of your request. - `ccv-average` is the average number of concurrent viewers in the timeframe of your request. - `view` is the total number of viewers. | | **from** | **Date**| no| Use this query parameter to define the starting date-time of the period you want analytics for. - If you do not set a value for `from`, the default assigned value is 1 day ago, based on the `to` parameter. - The maximum value is 30 days ago. - The value you provide should follow the ATOM date-time format: `2024-02-05T00:00:00+01:00` | | **to** | **Date**| no| Use this query parameter to define the ending date-time of the period you want analytics for. - If you do not set a value for `to`, the default assigned value is `now`. - The value for `to` is a non-inclusive value: the API returns data **before** the date-time that you set. | - | **interval** | **'hour' \| 'day'**| no| Use this query parameter to define how granularity of the data. Possible values: `hour`, `day`. - Default: If no interval specified and the period (different between from and to) ≤ 2 days then hour, otherwise day. - If you do not set a value for `interval`, and the period you set using the `from` and `to` parameters is less than or equals to 2 days, then the default assigned value is `hour`. Otherwise the API sets it to `day`. | + | **interval** | **'minute' \| 'hour' \| 'day'**| no| Use this query parameter to define the granularity of the data. Possible values: `minute`, `hour`, `day`. - If you do not set a value for `interval`, and the period you set using the `from` and `to` parameters is less than or equals to 2 days, then the default assigned value is `hour`. Otherwise the API sets it to `day`. - When you set `minute` as interval, the timeframe you define with the `from` and `to` parameters should be less than 60 minutes. | | **sortBy** | **'metricValue' \| 'emittedAt'**| no| Use this parameter to choose which field the API will use to sort the analytics data. These are the available fields to sort by: - `metricValue`: Sorts the results based on the **metric** you selected in your request. - `emittedAt`: Sorts the results based on the **timestamp** of the event in ATOM date-time format. | | **sortOrder** | **'asc' \| 'desc'**| no| Use this parameter to define the sort order of results. These are the available sort orders: - `asc`: Sorts the results in ascending order: `A to Z` and `0 to 9`. - `desc`: Sorts the results in descending order: `Z to A` and `9 to 0`. | - | **filterBy** | [**FilterBy2**](../model/.md)| no| Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. - The API only accepts the `mediaId` and `mediaType` filters when you call `/data/metrics/play/total` or `/data/buckets/play-total/media-id`. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `EU`. Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `FR`. - `deviceType`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. - `tag`: Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). | + | **unique** | **boolean**| no| Use this query parameter to control how viewer data is counted: - `true` means that a single user watchig multiple times counts as 1 unique viewer - `false` means that all views count, even if from the same user. The API accepts this parameter only when you use the `ccv-peak`, `ccv-average`, or `view` metric. Viewers are unique for 1 day. The API determines uniqueness based on a viewer's `user-agent` and IP address. This means that the API can filter viewers using multiple tabs to watch the same video multiple times, but cannot filter for viewers who use multiple browsers to watch the same content multiple times. | + | **viewDuration** | **'3s' \| '5s' \| '10s' \| '30s'**| no| Use this query parameter to define how many seconds a view has to last to be counted in analytics data. - You can only use this parameter together with the `view` metric. - The accepted values are `3s`, `5s`, `10s`, and `30s`. - If you do not set this parameter, the API defaults to `5s`. | + | **filterBy** | [**FilterBy2**](../model/.md)| no| Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. - The API only accepts the `mediaId` and `mediaType` filters when you call `/data/metrics/play/total` or `/data/buckets/play-total/media-id`. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `EU`. Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `FR`. - `deviceType`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. - `tag`: Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). - `referrer`: Filters data based on the URL where the view is originating from. Accepts an empty string as a value to filter view events where no referrer is available. | | **currentPage** | **number**| no| Choose the number of search results to return per page. Minimum value: 1 | | **pageSize** | **number**| no| Results per page. Allowed values 1-100, default is 25. | diff --git a/docs/model/AnalyticsAggregatedMetricsResponseContext.md b/docs/model/AnalyticsAggregatedMetricsResponseContext.md index f674467..a0969ff 100644 --- a/docs/model/AnalyticsAggregatedMetricsResponseContext.md +++ b/docs/model/AnalyticsAggregatedMetricsResponseContext.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**metric** | [**AnalyticsAggregatedMetricsResponseContextMetricEnum**](#AnalyticsAggregatedMetricsResponseContextMetricEnum) | Returns the metric you selected. | [optional] +**metric** | [**AnalyticsAggregatedMetricsResponseContextMetricEnum**](#AnalyticsAggregatedMetricsResponseContextMetricEnum) | Returns the metric and relevant parameters you selected. | [optional] **aggregation** | [**AnalyticsAggregatedMetricsResponseContextAggregationEnum**](#AnalyticsAggregatedMetricsResponseContextAggregationEnum) | Returns the aggregation you selected. | [optional] **timeframe** | [**AnalyticsAggregatedMetricsResponseContextTimeframe**](AnalyticsAggregatedMetricsResponseContextTimeframe.md) | | [optional] @@ -21,6 +21,17 @@ End | 'end' Impression | 'impression' ImpressionTime | 'impression-time' WatchTime | 'watch-time' +Ccv | 'ccv' +UniqueCcv | 'unique-ccv' +View3 | 'view-3' +View5 | 'view-5' +View10 | 'view-10' +View30 | 'view-30' +UniqueView | 'unique-view' +UniqueView3 | 'unique-view-3' +UniqueView5 | 'unique-view-5' +UniqueView10 | 'unique-view-10' +UniqueView30 | 'unique-view-30' diff --git a/docs/model/AnalyticsMetricsBreakdownResponseContext.md b/docs/model/AnalyticsMetricsBreakdownResponseContext.md index f3b0e50..52c8653 100644 --- a/docs/model/AnalyticsMetricsBreakdownResponseContext.md +++ b/docs/model/AnalyticsMetricsBreakdownResponseContext.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**metric** | [**AnalyticsMetricsBreakdownResponseContextMetricEnum**](#AnalyticsMetricsBreakdownResponseContextMetricEnum) | Returns the metric you selected. | [optional] +**metric** | [**AnalyticsMetricsBreakdownResponseContextMetricEnum**](#AnalyticsMetricsBreakdownResponseContextMetricEnum) | Returns the metric and relevant parameters you selected. | [optional] **breakdown** | [**AnalyticsMetricsBreakdownResponseContextBreakdownEnum**](#AnalyticsMetricsBreakdownResponseContextBreakdownEnum) | Returns the dimension you selected. | [optional] **timeframe** | [**AnalyticsAggregatedMetricsResponseContextTimeframe**](AnalyticsAggregatedMetricsResponseContextTimeframe.md) | | [optional] @@ -20,6 +20,19 @@ PlayRate | 'play-rate' Start | 'start' End | 'end' Impression | 'impression' +CcvAverage | 'ccv-average' +CcvPeak | 'ccv-peak' +UniqueCcvAverage | 'unique-ccv-average' +UniqueCcvPeak | 'unique-ccv-peak' +View3 | 'view-3' +View5 | 'view-5' +View10 | 'view-10' +View30 | 'view-30' +UniqueView | 'unique-view' +UniqueView3 | 'unique-view-3' +UniqueView5 | 'unique-view-5' +UniqueView10 | 'unique-view-10' +UniqueView30 | 'unique-view-30' diff --git a/docs/model/AnalyticsMetricsOverTimeResponse.md b/docs/model/AnalyticsMetricsOverTimeResponse.md index 083b163..507e165 100644 --- a/docs/model/AnalyticsMetricsOverTimeResponse.md +++ b/docs/model/AnalyticsMetricsOverTimeResponse.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **context** | [**AnalyticsMetricsOverTimeResponseContext**](AnalyticsMetricsOverTimeResponseContext.md) | | -**data** | [**Array<AnalyticsMetricsOverTimeResponseData>**](AnalyticsMetricsOverTimeResponseData.md) | Returns an array of metrics and the timestamps . | +**data** | [**Array<AnalyticsMetricsOverTimeResponseData>**](AnalyticsMetricsOverTimeResponseData.md) | Returns an array of metrics and the timestamps. | **pagination** | [**Pagination**](Pagination.md) | | diff --git a/docs/model/AnalyticsMetricsOverTimeResponseContext.md b/docs/model/AnalyticsMetricsOverTimeResponseContext.md index d3775b6..d09e847 100644 --- a/docs/model/AnalyticsMetricsOverTimeResponseContext.md +++ b/docs/model/AnalyticsMetricsOverTimeResponseContext.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**metric** | [**AnalyticsMetricsOverTimeResponseContextMetricEnum**](#AnalyticsMetricsOverTimeResponseContextMetricEnum) | Returns the metric you selected. | [optional] +**metric** | [**AnalyticsMetricsOverTimeResponseContextMetricEnum**](#AnalyticsMetricsOverTimeResponseContextMetricEnum) | Returns the metric and relevant parameters you selected. | [optional] **interval** | [**AnalyticsMetricsOverTimeResponseContextIntervalEnum**](#AnalyticsMetricsOverTimeResponseContextIntervalEnum) | Returns the interval you selected. | [optional] **timeframe** | [**AnalyticsAggregatedMetricsResponseContextTimeframe**](AnalyticsAggregatedMetricsResponseContextTimeframe.md) | | [optional] @@ -20,6 +20,19 @@ PlayRate | 'play-rate' Start | 'start' End | 'end' Impression | 'impression' +CcvAverage | 'ccv-average' +CcvPeak | 'ccv-peak' +UniqueCcvAverage | 'unique-ccv-average' +UniqueCcvPeak | 'unique-ccv-peak' +View3 | 'view-3' +View5 | 'view-5' +View10 | 'view-10' +View30 | 'view-30' +UniqueView | 'unique-view' +UniqueView3 | 'unique-view-3' +UniqueView5 | 'unique-view-5' +UniqueView10 | 'unique-view-10' +UniqueView30 | 'unique-view-30' @@ -27,6 +40,7 @@ Impression | 'impression' Name | Value ---- | ----- +Minute | 'minute' Hour | 'hour' Day | 'day' diff --git a/docs/model/FilterBy.md b/docs/model/FilterBy.md index 024a468..55017dd 100644 --- a/docs/model/FilterBy.md +++ b/docs/model/FilterBy.md @@ -13,6 +13,7 @@ Name | Type | Description | Notes **operatingSystem** | **Array<string>** | Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. | [optional] **browser** | **Array<string>** | Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. | [optional] **tag** | **string** | Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). | [optional] +**referrer** | **Array<string>** | Filters data based on the URL where the view is originating from. This filter parameter accepts an empty string to filter view events where no referrer is available. | [optional] diff --git a/docs/model/FilterBy1.md b/docs/model/FilterBy1.md index c2b7215..0688254 100644 --- a/docs/model/FilterBy1.md +++ b/docs/model/FilterBy1.md @@ -13,6 +13,7 @@ Name | Type | Description | Notes **operatingSystem** | **Array<string>** | Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. | [optional] **browser** | **Array<string>** | Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. | [optional] **tag** | **string** | Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). | [optional] +**referrer** | **Array<string>** | Filters data based on the URL where the view is originating from. This filter parameter accepts an empty string to filter view events where no referrer is available. | [optional] diff --git a/docs/model/FilterBy2.md b/docs/model/FilterBy2.md index 9b7fdcf..ed9e0af 100644 --- a/docs/model/FilterBy2.md +++ b/docs/model/FilterBy2.md @@ -13,6 +13,7 @@ Name | Type | Description | Notes **operatingSystem** | **Array<string>** | Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. | [optional] **browser** | **Array<string>** | Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. | [optional] **tag** | **string** | Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). | [optional] +**referrer** | **Array<string>** | Filters data based on the URL where the view is originating from. This filter parameter accepts an empty string to filter view events where no referrer is available. | [optional] diff --git a/package.json b/package.json index d7c87a3..a10b9df 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@api.video/nodejs-client", - "version": "2.6.6", + "version": "2.6.7", "description": "api.video nodejs API client", "keywords": [ "api.video", diff --git a/src/HttpClient.ts b/src/HttpClient.ts index d6ef8bc..b201aa4 100644 --- a/src/HttpClient.ts +++ b/src/HttpClient.ts @@ -59,7 +59,7 @@ export default class HttpClient { this.chunkSize = params.chunkSize; this.headers = new AxiosHeaders({ Accept: 'application/json, */*;q=0.8', - 'AV-Origin-Client': 'nodejs:2.6.6', + 'AV-Origin-Client': 'nodejs:2.6.7', Authorization: this.apiKey ? `Basic ${encode(`${this.apiKey}:`)}` : '', ...(params.applicationName && params.applicationVersion ? { diff --git a/src/api/AnalyticsApi.ts b/src/api/AnalyticsApi.ts index a212df9..fad1b69 100644 --- a/src/api/AnalyticsApi.ts +++ b/src/api/AnalyticsApi.ts @@ -31,11 +31,13 @@ export default class AnalyticsApi { * Retrieve time-based and countable metrics like average watch time or the number of impressions over a certain period of time. * Retrieve aggregated metrics * @param {Object} searchParams - * @param { 'play' | 'start' | 'end' | 'impression' | 'impression-time' | 'watch-time' } searchParams.metric Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. You can use the aggregations `count`, `rate`, and `total` with the `play` metric. - `start` is the number of times playback was started. You can use the aggregation `count` with this metric. - `end` is the number of times playback has ended with the content watch until the end. You can use the aggregation `count` with this metric. - `impression` is the number of times your content has been loaded and was ready for playback. You can use the aggregation `count` with this metric. - `impression-time` is the time in milliseconds that your content was loading for until the first video frame is displayed. You can use the aggregations `average` and `sum` with this metric. - `watch-time` is the cumulative time in seconds that the user has spent watching your content. You can use the aggregations `average` and `sum` with this metric. - * @param { 'count' | 'rate' | 'total' | 'average' | 'sum' } searchParams.aggregation Use this path parameter to define a way of collecting data for the metric that you want analytics for. - `count` returns the overall number of events for the `play` metric. - `rate` returns the ratio that calculates the number of plays your content receives divided by its impressions. This aggregation can be used only with the `play` metric. - `total` calculates the total number of events for the `play` metric. - `average` calculates an average value for the selected metric. - `sum` adds up the total value of the select metric. + * @param { 'play' | 'start' | 'end' | 'impression' | 'impression-time' | 'watch-time' | 'ccv' | 'view' } searchParams.metric Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. You can use the aggregations `count`, `rate`, and `total` with the `play` metric. - `start` is the number of times playback was started. You can use the aggregation `count` with this metric. - `end` is the number of times playback has ended with the content watch until the end. You can use the aggregation `count` with this metric. - `impression` is the number of times your content has been loaded and was ready for playback. You can use the aggregation `count` with this metric. - `impression-time` is the time in milliseconds that your content was loading for until the first video frame is displayed. You can use the aggregations `average` and `sum` with this metric. - `watch-time` is the cumulative time in seconds that the user has spent watching your content. You can use the aggregations `average` and `sum` with this metric. - `ccv`: is the number of concurrent viewers, or users watching at the same time. - `view`: the total number of viewers until this point in time. + * @param { 'count' | 'rate' | 'total' | 'average' | 'sum' | 'peak' | 'live' } searchParams.aggregation Use this path parameter to define a way of collecting data for the metric that you want analytics for. - `count` returns the overall number of events for the `play` metric. - `rate` returns the ratio that calculates the number of plays your content receives divided by its impressions. This aggregation can be used only with the `play` metric. - `total` calculates the total number of events for the `play` metric. - `average` calculates an average value for the selected metric. - `sum` adds up the total value of the select metric. - `peak` shows the highest value of the `ccv` metric in the timeframe of your request. You can use this aggregation only with the `ccv` metric. - `live` shows the highest value of the `ccv` metric from the last 20 seconds. You can use this aggregation only with the `ccv` metric. * @param { Date } searchParams.from Use this query parameter to define the starting date-time of the period you want analytics for. - If you do not set a value for `from`, the default assigned value is 1 day ago, based on the `to` parameter. - The maximum value is 30 days ago. - The value you provide should follow the ATOM date-time format: `2024-02-05T00:00:00+01:00` - The API ignores this parameter when you call `/data/metrics/play/total`. * @param { Date } searchParams.to Use this query parameter to define the ending date-time of the period you want analytics for. - If you do not set a value for `to`, the default assigned value is `now`. - The API ignores this parameter when you call `/data/metrics/play/total`. - The value for `to` is a non-inclusive value: the API returns data **before** the date-time that you set. - * @param { FilterBy2 } searchParams.filterBy Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. - The API only accepts the `mediaId` and `mediaType` filters when you call `/data/metrics/play/total` or `/data/buckets/play-total/media-id`. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `EU`. Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `FR`. - `deviceType`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. - `tag`: Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). + * @param { boolean } searchParams.unique Use this query parameter to control how viewer data is counted: - `true` means that a single user watchig multiple times counts as 1 unique viewer - `false` means that all views count, even if from the same user. The API accepts this parameter only when you use the `ccv-peak`, `ccv-average`, or `view` metric. Viewers are unique for 1 day. The API determines uniqueness based on a viewer's `user-agent` and IP address. This means that the API can filter viewers using multiple tabs to watch the same video multiple times, but cannot filter for viewers who use multiple browsers to watch the same content multiple times. + * @param { '3s' | '5s' | '10s' | '30s' } searchParams.viewDuration Use this query parameter to define how many seconds a view has to last to be counted in analytics data. - You can only use this parameter together with the `view` metric. - The accepted values are `3s`, `5s`, `10s`, and `30s`. - If you do not set this parameter, the API defaults to `5s`. + * @param { FilterBy2 } searchParams.filterBy Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. - The API only accepts the `mediaId` and `mediaType` filters when you call `/data/metrics/play/total` or `/data/buckets/play-total/media-id`. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `EU`. Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `FR`. - `deviceType`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. - `tag`: Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). - `referrer`: Filters data based on the URL where the view is originating from. Accepts an empty string as a value to filter view events where no referrer is available. */ public async getAggregatedMetrics(args: { metric: @@ -44,10 +46,21 @@ export default class AnalyticsApi { | 'end' | 'impression' | 'impression-time' - | 'watch-time'; - aggregation: 'count' | 'rate' | 'total' | 'average' | 'sum'; + | 'watch-time' + | 'ccv' + | 'view'; + aggregation: + | 'count' + | 'rate' + | 'total' + | 'average' + | 'sum' + | 'peak' + | 'live'; from?: Date; to?: Date; + unique?: boolean; + viewDuration?: '3s' | '5s' | '10s' | '30s'; filterBy?: FilterBy2; }): Promise { return this.getAggregatedMetricsWithResponseHeaders(args).then( @@ -59,17 +72,21 @@ export default class AnalyticsApi { * Retrieve time-based and countable metrics like average watch time or the number of impressions over a certain period of time. * Retrieve aggregated metrics * @param {Object} searchParams - * @param { 'play' | 'start' | 'end' | 'impression' | 'impression-time' | 'watch-time' } searchParams.metric Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. You can use the aggregations `count`, `rate`, and `total` with the `play` metric. - `start` is the number of times playback was started. You can use the aggregation `count` with this metric. - `end` is the number of times playback has ended with the content watch until the end. You can use the aggregation `count` with this metric. - `impression` is the number of times your content has been loaded and was ready for playback. You can use the aggregation `count` with this metric. - `impression-time` is the time in milliseconds that your content was loading for until the first video frame is displayed. You can use the aggregations `average` and `sum` with this metric. - `watch-time` is the cumulative time in seconds that the user has spent watching your content. You can use the aggregations `average` and `sum` with this metric. - * @param { 'count' | 'rate' | 'total' | 'average' | 'sum' } searchParams.aggregation Use this path parameter to define a way of collecting data for the metric that you want analytics for. - `count` returns the overall number of events for the `play` metric. - `rate` returns the ratio that calculates the number of plays your content receives divided by its impressions. This aggregation can be used only with the `play` metric. - `total` calculates the total number of events for the `play` metric. - `average` calculates an average value for the selected metric. - `sum` adds up the total value of the select metric. + * @param { 'play' | 'start' | 'end' | 'impression' | 'impression-time' | 'watch-time' | 'ccv' | 'view' } searchParams.metric Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. You can use the aggregations `count`, `rate`, and `total` with the `play` metric. - `start` is the number of times playback was started. You can use the aggregation `count` with this metric. - `end` is the number of times playback has ended with the content watch until the end. You can use the aggregation `count` with this metric. - `impression` is the number of times your content has been loaded and was ready for playback. You can use the aggregation `count` with this metric. - `impression-time` is the time in milliseconds that your content was loading for until the first video frame is displayed. You can use the aggregations `average` and `sum` with this metric. - `watch-time` is the cumulative time in seconds that the user has spent watching your content. You can use the aggregations `average` and `sum` with this metric. - `ccv`: is the number of concurrent viewers, or users watching at the same time. - `view`: the total number of viewers until this point in time. + * @param { 'count' | 'rate' | 'total' | 'average' | 'sum' | 'peak' | 'live' } searchParams.aggregation Use this path parameter to define a way of collecting data for the metric that you want analytics for. - `count` returns the overall number of events for the `play` metric. - `rate` returns the ratio that calculates the number of plays your content receives divided by its impressions. This aggregation can be used only with the `play` metric. - `total` calculates the total number of events for the `play` metric. - `average` calculates an average value for the selected metric. - `sum` adds up the total value of the select metric. - `peak` shows the highest value of the `ccv` metric in the timeframe of your request. You can use this aggregation only with the `ccv` metric. - `live` shows the highest value of the `ccv` metric from the last 20 seconds. You can use this aggregation only with the `ccv` metric. * @param { Date } searchParams.from Use this query parameter to define the starting date-time of the period you want analytics for. - If you do not set a value for `from`, the default assigned value is 1 day ago, based on the `to` parameter. - The maximum value is 30 days ago. - The value you provide should follow the ATOM date-time format: `2024-02-05T00:00:00+01:00` - The API ignores this parameter when you call `/data/metrics/play/total`. * @param { Date } searchParams.to Use this query parameter to define the ending date-time of the period you want analytics for. - If you do not set a value for `to`, the default assigned value is `now`. - The API ignores this parameter when you call `/data/metrics/play/total`. - The value for `to` is a non-inclusive value: the API returns data **before** the date-time that you set. - * @param { FilterBy2 } searchParams.filterBy Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. - The API only accepts the `mediaId` and `mediaType` filters when you call `/data/metrics/play/total` or `/data/buckets/play-total/media-id`. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `EU`. Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `FR`. - `deviceType`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. - `tag`: Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). + * @param { boolean } searchParams.unique Use this query parameter to control how viewer data is counted: - `true` means that a single user watchig multiple times counts as 1 unique viewer - `false` means that all views count, even if from the same user. The API accepts this parameter only when you use the `ccv-peak`, `ccv-average`, or `view` metric. Viewers are unique for 1 day. The API determines uniqueness based on a viewer's `user-agent` and IP address. This means that the API can filter viewers using multiple tabs to watch the same video multiple times, but cannot filter for viewers who use multiple browsers to watch the same content multiple times. + * @param { '3s' | '5s' | '10s' | '30s' } searchParams.viewDuration Use this query parameter to define how many seconds a view has to last to be counted in analytics data. - You can only use this parameter together with the `view` metric. - The accepted values are `3s`, `5s`, `10s`, and `30s`. - If you do not set this parameter, the API defaults to `5s`. + * @param { FilterBy2 } searchParams.filterBy Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. - The API only accepts the `mediaId` and `mediaType` filters when you call `/data/metrics/play/total` or `/data/buckets/play-total/media-id`. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `EU`. Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `FR`. - `deviceType`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. - `tag`: Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). - `referrer`: Filters data based on the URL where the view is originating from. Accepts an empty string as a value to filter view events where no referrer is available. */ public async getAggregatedMetricsWithResponseHeaders({ metric, aggregation, from, to, + unique, + viewDuration, filterBy, }: { metric: @@ -78,10 +95,21 @@ export default class AnalyticsApi { | 'end' | 'impression' | 'impression-time' - | 'watch-time'; - aggregation: 'count' | 'rate' | 'total' | 'average' | 'sum'; + | 'watch-time' + | 'ccv' + | 'view'; + aggregation: + | 'count' + | 'rate' + | 'total' + | 'average' + | 'sum' + | 'peak' + | 'live'; from?: Date; to?: Date; + unique?: boolean; + viewDuration?: '3s' | '5s' | '10s' | '30s'; filterBy?: FilterBy2; }): Promise<{ headers: ApiResponseHeaders; @@ -123,6 +151,22 @@ export default class AnalyticsApi { ObjectSerializer.serialize(to, 'Date', 'date-time') ); } + if (unique !== undefined) { + urlSearchParams.append( + 'unique', + ObjectSerializer.serialize(unique, 'boolean', '') + ); + } + if (viewDuration !== undefined) { + urlSearchParams.append( + 'viewDuration', + ObjectSerializer.serialize( + viewDuration, + "'3s' | '5s' | '10s' | '30s'", + '' + ) + ); + } if (filterBy !== undefined) { if (typeof filterBy !== 'object') { throw new Error(`${filterBy} is not an object`); @@ -171,13 +215,15 @@ export default class AnalyticsApi { * Retrieve detailed analytics play-rate and number of impressions segmented by dimensions like country or device type. * Retrieve metrics in a breakdown of dimensions * @param {Object} searchParams - * @param { 'play' | 'play-rate' | 'play-total' | 'start' | 'end' | 'impression' } searchParams.metric Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. - `play-rate` is the ratio that calculates the number of plays your content receives divided by its impressions. - `play-total` is the total number of times a specific content has been played. You can only use the `media-id` breakdown with this metric. - `start` is the number of times playback was started. - `end` is the number of times playback has ended with the content watch until the end. - `impression` is the number of times your content has been loaded and was ready for playback. - * @param { 'media-id' | 'media-type' | 'continent' | 'country' | 'device-type' | 'operating-system' | 'browser' } searchParams.breakdown Use this path parameter to define a dimension for segmenting analytics data. You must use `kebab-case` for path parameters. These are the available dimensions: - `media-id`: Returns analytics based on the unique identifiers of a video or a live stream. - `media-type`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `device-type`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operating-system`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. + * @param { 'play' | 'play-rate' | 'play-total' | 'start' | 'end' | 'impression' | 'ccv-peak' | 'ccv-average' | 'view' } searchParams.metric Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. - `play-rate` is the ratio that calculates the number of plays your content receives divided by its impressions. - `play-total` is the total number of times a specific content has been played. You can only use the `media-id` breakdown with this metric. - `start` is the number of times playback was started. - `end` is the number of times playback has ended with the content watch until the end. - `impression` is the number of times your content has been loaded and was ready for playback. - `ccv-peak` is the highest number of concurrent viewers in the timeframe of your request. - `ccv-average` is the average number of concurrent viewers in the timeframe of your request. - `view` is the total number of viewers until this point in time. + * @param { 'media-id' | 'media-type' | 'continent' | 'country' | 'device-type' | 'operating-system' | 'browser' | 'referrer' } searchParams.breakdown Use this path parameter to define a dimension for segmenting analytics data. You must use `kebab-case` for path parameters. These are the available dimensions: - `media-id`: Returns analytics based on the unique identifiers of a video or a live stream. - `media-type`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `device-type`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operating-system`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. - `referrer`: Returns the URL where the view originates from, for example a website where the video is embedded. View events from Android and iOS return empty strings as referrer. * @param { Date } searchParams.from Use this query parameter to define the starting date-time of the period you want analytics for. - If you do not set a value for `from`, the default assigned value is 1 day ago, based on the `to` parameter. - The maximum value is 30 days ago. - The value you provide should follow the ATOM date-time format: `2024-02-05T00:00:00+01:00` * @param { Date } searchParams.to Use this query parameter to define the ending date-time of the period you want analytics for. - If you do not set a value for `to`, the default assigned value is `now`. - The value for `to` is a non-inclusive value: the API returns data **before** the date-time that you set. * @param { 'metricValue' | 'dimensionValue' } searchParams.sortBy Use this parameter to choose which field the API will use to sort the analytics data. These are the available fields to sort by: - `metricValue`: Sorts the results based on the **metric** you selected in your request. - `dimensionValue`: Sorts the results based on the **dimension** you selected in your request. * @param { 'asc' | 'desc' } searchParams.sortOrder Use this parameter to define the sort order of results. These are the available sort orders: - `asc`: Sorts the results in ascending order: `A to Z` and `0 to 9`. - `desc`: Sorts the results in descending order: `Z to A` and `9 to 0`. - * @param { FilterBy2 } searchParams.filterBy Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. - The API only accepts the `mediaId` and `mediaType` filters when you call `/data/metrics/play/total` or `/data/buckets/play-total/media-id`. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `EU`. Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `FR`. - `deviceType`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. - `tag`: Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). + * @param { boolean } searchParams.unique Use this query parameter to control how viewer data is counted: - `true` means that a single user watchig multiple times counts as 1 unique viewer - `false` means that all views count, even if from the same user. The API accepts this parameter only when you use the `ccv-peak`, `ccv-average`, or `view` metric. Viewers are unique for 1 day. The API determines uniqueness based on a viewer's `user-agent` and IP address. This means that the API can filter viewers using multiple tabs to watch the same video multiple times, but cannot filter for viewers who use multiple browsers to watch the same content multiple times. + * @param { '3s' | '5s' | '10s' | '30s' } searchParams.viewDuration Use this query parameter to define how many seconds a view has to last to be counted in analytics data. - You can only use this parameter together with the `view` metric. - The accepted values are `3s`, `5s`, `10s`, and `30s`. - If you do not set this parameter, the API defaults to `5s`. + * @param { FilterBy2 } searchParams.filterBy Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. - The API only accepts the `mediaId` and `mediaType` filters when you call `/data/metrics/play/total` or `/data/buckets/play-total/media-id`. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `EU`. Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `FR`. - `deviceType`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. - `tag`: Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). - `referrer`: Filters data based on the URL where the view is originating from. Accepts an empty string as a value to filter view events where no referrer is available. * @param { number } searchParams.currentPage Choose the number of search results to return per page. Minimum value: 1 * @param { number } searchParams.pageSize Results per page. Allowed values 1-100, default is 25. */ @@ -188,7 +234,10 @@ export default class AnalyticsApi { | 'play-total' | 'start' | 'end' - | 'impression'; + | 'impression' + | 'ccv-peak' + | 'ccv-average' + | 'view'; breakdown: | 'media-id' | 'media-type' @@ -196,11 +245,14 @@ export default class AnalyticsApi { | 'country' | 'device-type' | 'operating-system' - | 'browser'; + | 'browser' + | 'referrer'; from?: Date; to?: Date; sortBy?: 'metricValue' | 'dimensionValue'; sortOrder?: 'asc' | 'desc'; + unique?: boolean; + viewDuration?: '3s' | '5s' | '10s' | '30s'; filterBy?: FilterBy2; currentPage?: number; pageSize?: number; @@ -214,13 +266,15 @@ export default class AnalyticsApi { * Retrieve detailed analytics play-rate and number of impressions segmented by dimensions like country or device type. * Retrieve metrics in a breakdown of dimensions * @param {Object} searchParams - * @param { 'play' | 'play-rate' | 'play-total' | 'start' | 'end' | 'impression' } searchParams.metric Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. - `play-rate` is the ratio that calculates the number of plays your content receives divided by its impressions. - `play-total` is the total number of times a specific content has been played. You can only use the `media-id` breakdown with this metric. - `start` is the number of times playback was started. - `end` is the number of times playback has ended with the content watch until the end. - `impression` is the number of times your content has been loaded and was ready for playback. - * @param { 'media-id' | 'media-type' | 'continent' | 'country' | 'device-type' | 'operating-system' | 'browser' } searchParams.breakdown Use this path parameter to define a dimension for segmenting analytics data. You must use `kebab-case` for path parameters. These are the available dimensions: - `media-id`: Returns analytics based on the unique identifiers of a video or a live stream. - `media-type`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `device-type`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operating-system`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. + * @param { 'play' | 'play-rate' | 'play-total' | 'start' | 'end' | 'impression' | 'ccv-peak' | 'ccv-average' | 'view' } searchParams.metric Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. - `play-rate` is the ratio that calculates the number of plays your content receives divided by its impressions. - `play-total` is the total number of times a specific content has been played. You can only use the `media-id` breakdown with this metric. - `start` is the number of times playback was started. - `end` is the number of times playback has ended with the content watch until the end. - `impression` is the number of times your content has been loaded and was ready for playback. - `ccv-peak` is the highest number of concurrent viewers in the timeframe of your request. - `ccv-average` is the average number of concurrent viewers in the timeframe of your request. - `view` is the total number of viewers until this point in time. + * @param { 'media-id' | 'media-type' | 'continent' | 'country' | 'device-type' | 'operating-system' | 'browser' | 'referrer' } searchParams.breakdown Use this path parameter to define a dimension for segmenting analytics data. You must use `kebab-case` for path parameters. These are the available dimensions: - `media-id`: Returns analytics based on the unique identifiers of a video or a live stream. - `media-type`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `device-type`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operating-system`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. - `referrer`: Returns the URL where the view originates from, for example a website where the video is embedded. View events from Android and iOS return empty strings as referrer. * @param { Date } searchParams.from Use this query parameter to define the starting date-time of the period you want analytics for. - If you do not set a value for `from`, the default assigned value is 1 day ago, based on the `to` parameter. - The maximum value is 30 days ago. - The value you provide should follow the ATOM date-time format: `2024-02-05T00:00:00+01:00` * @param { Date } searchParams.to Use this query parameter to define the ending date-time of the period you want analytics for. - If you do not set a value for `to`, the default assigned value is `now`. - The value for `to` is a non-inclusive value: the API returns data **before** the date-time that you set. * @param { 'metricValue' | 'dimensionValue' } searchParams.sortBy Use this parameter to choose which field the API will use to sort the analytics data. These are the available fields to sort by: - `metricValue`: Sorts the results based on the **metric** you selected in your request. - `dimensionValue`: Sorts the results based on the **dimension** you selected in your request. * @param { 'asc' | 'desc' } searchParams.sortOrder Use this parameter to define the sort order of results. These are the available sort orders: - `asc`: Sorts the results in ascending order: `A to Z` and `0 to 9`. - `desc`: Sorts the results in descending order: `Z to A` and `9 to 0`. - * @param { FilterBy2 } searchParams.filterBy Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. - The API only accepts the `mediaId` and `mediaType` filters when you call `/data/metrics/play/total` or `/data/buckets/play-total/media-id`. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `EU`. Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `FR`. - `deviceType`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. - `tag`: Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). + * @param { boolean } searchParams.unique Use this query parameter to control how viewer data is counted: - `true` means that a single user watchig multiple times counts as 1 unique viewer - `false` means that all views count, even if from the same user. The API accepts this parameter only when you use the `ccv-peak`, `ccv-average`, or `view` metric. Viewers are unique for 1 day. The API determines uniqueness based on a viewer's `user-agent` and IP address. This means that the API can filter viewers using multiple tabs to watch the same video multiple times, but cannot filter for viewers who use multiple browsers to watch the same content multiple times. + * @param { '3s' | '5s' | '10s' | '30s' } searchParams.viewDuration Use this query parameter to define how many seconds a view has to last to be counted in analytics data. - You can only use this parameter together with the `view` metric. - The accepted values are `3s`, `5s`, `10s`, and `30s`. - If you do not set this parameter, the API defaults to `5s`. + * @param { FilterBy2 } searchParams.filterBy Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. - The API only accepts the `mediaId` and `mediaType` filters when you call `/data/metrics/play/total` or `/data/buckets/play-total/media-id`. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `EU`. Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `FR`. - `deviceType`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. - `tag`: Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). - `referrer`: Filters data based on the URL where the view is originating from. Accepts an empty string as a value to filter view events where no referrer is available. * @param { number } searchParams.currentPage Choose the number of search results to return per page. Minimum value: 1 * @param { number } searchParams.pageSize Results per page. Allowed values 1-100, default is 25. */ @@ -231,6 +285,8 @@ export default class AnalyticsApi { to, sortBy, sortOrder, + unique, + viewDuration, filterBy, currentPage, pageSize, @@ -241,7 +297,10 @@ export default class AnalyticsApi { | 'play-total' | 'start' | 'end' - | 'impression'; + | 'impression' + | 'ccv-peak' + | 'ccv-average' + | 'view'; breakdown: | 'media-id' | 'media-type' @@ -249,11 +308,14 @@ export default class AnalyticsApi { | 'country' | 'device-type' | 'operating-system' - | 'browser'; + | 'browser' + | 'referrer'; from?: Date; to?: Date; sortBy?: 'metricValue' | 'dimensionValue'; sortOrder?: 'asc' | 'desc'; + unique?: boolean; + viewDuration?: '3s' | '5s' | '10s' | '30s'; filterBy?: FilterBy2; currentPage?: number; pageSize?: number; @@ -310,6 +372,22 @@ export default class AnalyticsApi { ObjectSerializer.serialize(sortOrder, "'asc' | 'desc'", '') ); } + if (unique !== undefined) { + urlSearchParams.append( + 'unique', + ObjectSerializer.serialize(unique, 'boolean', '') + ); + } + if (viewDuration !== undefined) { + urlSearchParams.append( + 'viewDuration', + ObjectSerializer.serialize( + viewDuration, + "'3s' | '5s' | '10s' | '30s'", + '' + ) + ); + } if (filterBy !== undefined) { if (typeof filterBy !== 'object') { throw new Error(`${filterBy} is not an object`); @@ -370,23 +448,35 @@ export default class AnalyticsApi { * Retrieve countable metrics like the number of plays or impressions, grouped by the time at which they occurred * Retrieve metrics over time * @param {Object} searchParams - * @param { 'play' | 'play-rate' | 'start' | 'end' | 'impression' } searchParams.metric Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. - `play-rate` is the ratio that calculates the number of plays your content receives divided by its impressions. - `start` is the number of times playback was started. - `end` is the number of times playback has ended with the content watch until the end. - `impression` is the number of times your content has been loaded and was ready for playback. + * @param { 'play' | 'play-rate' | 'start' | 'end' | 'impression' | 'ccv-peak' | 'ccv-average' | 'view' } searchParams.metric Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. - `play-rate` is the ratio that calculates the number of plays your content receives divided by its impressions. - `start` is the number of times playback was started. - `end` is the number of times playback has ended with the content watch until the end. - `impression` is the number of times your content has been loaded and was ready for playback. - `ccv-peak` is the highest number of concurrent viewers in the timeframe of your request. - `ccv-average` is the average number of concurrent viewers in the timeframe of your request. - `view` is the total number of viewers. * @param { Date } searchParams.from Use this query parameter to define the starting date-time of the period you want analytics for. - If you do not set a value for `from`, the default assigned value is 1 day ago, based on the `to` parameter. - The maximum value is 30 days ago. - The value you provide should follow the ATOM date-time format: `2024-02-05T00:00:00+01:00` * @param { Date } searchParams.to Use this query parameter to define the ending date-time of the period you want analytics for. - If you do not set a value for `to`, the default assigned value is `now`. - The value for `to` is a non-inclusive value: the API returns data **before** the date-time that you set. - * @param { 'hour' | 'day' } searchParams.interval Use this query parameter to define how granularity of the data. Possible values: `hour`, `day`. - Default: If no interval specified and the period (different between from and to) ≤ 2 days then hour, otherwise day. - If you do not set a value for `interval`, and the period you set using the `from` and `to` parameters is less than or equals to 2 days, then the default assigned value is `hour`. Otherwise the API sets it to `day`. + * @param { 'minute' | 'hour' | 'day' } searchParams.interval Use this query parameter to define the granularity of the data. Possible values: `minute`, `hour`, `day`. - If you do not set a value for `interval`, and the period you set using the `from` and `to` parameters is less than or equals to 2 days, then the default assigned value is `hour`. Otherwise the API sets it to `day`. - When you set `minute` as interval, the timeframe you define with the `from` and `to` parameters should be less than 60 minutes. * @param { 'metricValue' | 'emittedAt' } searchParams.sortBy Use this parameter to choose which field the API will use to sort the analytics data. These are the available fields to sort by: - `metricValue`: Sorts the results based on the **metric** you selected in your request. - `emittedAt`: Sorts the results based on the **timestamp** of the event in ATOM date-time format. * @param { 'asc' | 'desc' } searchParams.sortOrder Use this parameter to define the sort order of results. These are the available sort orders: - `asc`: Sorts the results in ascending order: `A to Z` and `0 to 9`. - `desc`: Sorts the results in descending order: `Z to A` and `9 to 0`. - * @param { FilterBy2 } searchParams.filterBy Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. - The API only accepts the `mediaId` and `mediaType` filters when you call `/data/metrics/play/total` or `/data/buckets/play-total/media-id`. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `EU`. Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `FR`. - `deviceType`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. - `tag`: Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). + * @param { boolean } searchParams.unique Use this query parameter to control how viewer data is counted: - `true` means that a single user watchig multiple times counts as 1 unique viewer - `false` means that all views count, even if from the same user. The API accepts this parameter only when you use the `ccv-peak`, `ccv-average`, or `view` metric. Viewers are unique for 1 day. The API determines uniqueness based on a viewer's `user-agent` and IP address. This means that the API can filter viewers using multiple tabs to watch the same video multiple times, but cannot filter for viewers who use multiple browsers to watch the same content multiple times. + * @param { '3s' | '5s' | '10s' | '30s' } searchParams.viewDuration Use this query parameter to define how many seconds a view has to last to be counted in analytics data. - You can only use this parameter together with the `view` metric. - The accepted values are `3s`, `5s`, `10s`, and `30s`. - If you do not set this parameter, the API defaults to `5s`. + * @param { FilterBy2 } searchParams.filterBy Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. - The API only accepts the `mediaId` and `mediaType` filters when you call `/data/metrics/play/total` or `/data/buckets/play-total/media-id`. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `EU`. Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `FR`. - `deviceType`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. - `tag`: Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). - `referrer`: Filters data based on the URL where the view is originating from. Accepts an empty string as a value to filter view events where no referrer is available. * @param { number } searchParams.currentPage Choose the number of search results to return per page. Minimum value: 1 * @param { number } searchParams.pageSize Results per page. Allowed values 1-100, default is 25. */ public async getMetricsOverTime(args: { - metric: 'play' | 'play-rate' | 'start' | 'end' | 'impression'; + metric: + | 'play' + | 'play-rate' + | 'start' + | 'end' + | 'impression' + | 'ccv-peak' + | 'ccv-average' + | 'view'; from?: Date; to?: Date; - interval?: 'hour' | 'day'; + interval?: 'minute' | 'hour' | 'day'; sortBy?: 'metricValue' | 'emittedAt'; sortOrder?: 'asc' | 'desc'; + unique?: boolean; + viewDuration?: '3s' | '5s' | '10s' | '30s'; filterBy?: FilterBy2; currentPage?: number; pageSize?: number; @@ -400,13 +490,15 @@ export default class AnalyticsApi { * Retrieve countable metrics like the number of plays or impressions, grouped by the time at which they occurred * Retrieve metrics over time * @param {Object} searchParams - * @param { 'play' | 'play-rate' | 'start' | 'end' | 'impression' } searchParams.metric Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. - `play-rate` is the ratio that calculates the number of plays your content receives divided by its impressions. - `start` is the number of times playback was started. - `end` is the number of times playback has ended with the content watch until the end. - `impression` is the number of times your content has been loaded and was ready for playback. + * @param { 'play' | 'play-rate' | 'start' | 'end' | 'impression' | 'ccv-peak' | 'ccv-average' | 'view' } searchParams.metric Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. - `play-rate` is the ratio that calculates the number of plays your content receives divided by its impressions. - `start` is the number of times playback was started. - `end` is the number of times playback has ended with the content watch until the end. - `impression` is the number of times your content has been loaded and was ready for playback. - `ccv-peak` is the highest number of concurrent viewers in the timeframe of your request. - `ccv-average` is the average number of concurrent viewers in the timeframe of your request. - `view` is the total number of viewers. * @param { Date } searchParams.from Use this query parameter to define the starting date-time of the period you want analytics for. - If you do not set a value for `from`, the default assigned value is 1 day ago, based on the `to` parameter. - The maximum value is 30 days ago. - The value you provide should follow the ATOM date-time format: `2024-02-05T00:00:00+01:00` * @param { Date } searchParams.to Use this query parameter to define the ending date-time of the period you want analytics for. - If you do not set a value for `to`, the default assigned value is `now`. - The value for `to` is a non-inclusive value: the API returns data **before** the date-time that you set. - * @param { 'hour' | 'day' } searchParams.interval Use this query parameter to define how granularity of the data. Possible values: `hour`, `day`. - Default: If no interval specified and the period (different between from and to) ≤ 2 days then hour, otherwise day. - If you do not set a value for `interval`, and the period you set using the `from` and `to` parameters is less than or equals to 2 days, then the default assigned value is `hour`. Otherwise the API sets it to `day`. + * @param { 'minute' | 'hour' | 'day' } searchParams.interval Use this query parameter to define the granularity of the data. Possible values: `minute`, `hour`, `day`. - If you do not set a value for `interval`, and the period you set using the `from` and `to` parameters is less than or equals to 2 days, then the default assigned value is `hour`. Otherwise the API sets it to `day`. - When you set `minute` as interval, the timeframe you define with the `from` and `to` parameters should be less than 60 minutes. * @param { 'metricValue' | 'emittedAt' } searchParams.sortBy Use this parameter to choose which field the API will use to sort the analytics data. These are the available fields to sort by: - `metricValue`: Sorts the results based on the **metric** you selected in your request. - `emittedAt`: Sorts the results based on the **timestamp** of the event in ATOM date-time format. * @param { 'asc' | 'desc' } searchParams.sortOrder Use this parameter to define the sort order of results. These are the available sort orders: - `asc`: Sorts the results in ascending order: `A to Z` and `0 to 9`. - `desc`: Sorts the results in descending order: `Z to A` and `9 to 0`. - * @param { FilterBy2 } searchParams.filterBy Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. - The API only accepts the `mediaId` and `mediaType` filters when you call `/data/metrics/play/total` or `/data/buckets/play-total/media-id`. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `EU`. Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `FR`. - `deviceType`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. - `tag`: Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). + * @param { boolean } searchParams.unique Use this query parameter to control how viewer data is counted: - `true` means that a single user watchig multiple times counts as 1 unique viewer - `false` means that all views count, even if from the same user. The API accepts this parameter only when you use the `ccv-peak`, `ccv-average`, or `view` metric. Viewers are unique for 1 day. The API determines uniqueness based on a viewer's `user-agent` and IP address. This means that the API can filter viewers using multiple tabs to watch the same video multiple times, but cannot filter for viewers who use multiple browsers to watch the same content multiple times. + * @param { '3s' | '5s' | '10s' | '30s' } searchParams.viewDuration Use this query parameter to define how many seconds a view has to last to be counted in analytics data. - You can only use this parameter together with the `view` metric. - The accepted values are `3s`, `5s`, `10s`, and `30s`. - If you do not set this parameter, the API defaults to `5s`. + * @param { FilterBy2 } searchParams.filterBy Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. - The API only accepts the `mediaId` and `mediaType` filters when you call `/data/metrics/play/total` or `/data/buckets/play-total/media-id`. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `EU`. Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `FR`. - `deviceType`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. - `tag`: Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). - `referrer`: Filters data based on the URL where the view is originating from. Accepts an empty string as a value to filter view events where no referrer is available. * @param { number } searchParams.currentPage Choose the number of search results to return per page. Minimum value: 1 * @param { number } searchParams.pageSize Results per page. Allowed values 1-100, default is 25. */ @@ -417,16 +509,28 @@ export default class AnalyticsApi { interval, sortBy, sortOrder, + unique, + viewDuration, filterBy, currentPage, pageSize, }: { - metric: 'play' | 'play-rate' | 'start' | 'end' | 'impression'; + metric: + | 'play' + | 'play-rate' + | 'start' + | 'end' + | 'impression' + | 'ccv-peak' + | 'ccv-average' + | 'view'; from?: Date; to?: Date; - interval?: 'hour' | 'day'; + interval?: 'minute' | 'hour' | 'day'; sortBy?: 'metricValue' | 'emittedAt'; sortOrder?: 'asc' | 'desc'; + unique?: boolean; + viewDuration?: '3s' | '5s' | '10s' | '30s'; filterBy?: FilterBy2; currentPage?: number; pageSize?: number; @@ -464,7 +568,7 @@ export default class AnalyticsApi { if (interval !== undefined) { urlSearchParams.append( 'interval', - ObjectSerializer.serialize(interval, "'hour' | 'day'", '') + ObjectSerializer.serialize(interval, "'minute' | 'hour' | 'day'", '') ); } if (sortBy !== undefined) { @@ -479,6 +583,22 @@ export default class AnalyticsApi { ObjectSerializer.serialize(sortOrder, "'asc' | 'desc'", '') ); } + if (unique !== undefined) { + urlSearchParams.append( + 'unique', + ObjectSerializer.serialize(unique, 'boolean', '') + ); + } + if (viewDuration !== undefined) { + urlSearchParams.append( + 'viewDuration', + ObjectSerializer.serialize( + viewDuration, + "'3s' | '5s' | '10s' | '30s'", + '' + ) + ); + } if (filterBy !== undefined) { if (typeof filterBy !== 'object') { throw new Error(`${filterBy} is not an object`); diff --git a/src/model/AnalyticsAggregatedMetricsResponseContext.ts b/src/model/AnalyticsAggregatedMetricsResponseContext.ts index b02c32d..348773c 100644 --- a/src/model/AnalyticsAggregatedMetricsResponseContext.ts +++ b/src/model/AnalyticsAggregatedMetricsResponseContext.ts @@ -14,7 +14,7 @@ import AnalyticsAggregatedMetricsResponseContextTimeframe from './AnalyticsAggre export default class AnalyticsAggregatedMetricsResponseContext { /** - * Returns the metric you selected. + * Returns the metric and relevant parameters you selected. */ 'metric'?: AnalyticsAggregatedMetricsResponseContextMetricEnum; /** @@ -57,7 +57,18 @@ export type AnalyticsAggregatedMetricsResponseContextMetricEnum = | 'end' | 'impression' | 'impression-time' - | 'watch-time'; + | 'watch-time' + | 'ccv' + | 'unique-ccv' + | 'view-3' + | 'view-5' + | 'view-10' + | 'view-30' + | 'unique-view' + | 'unique-view-3' + | 'unique-view-5' + | 'unique-view-10' + | 'unique-view-30'; export type AnalyticsAggregatedMetricsResponseContextAggregationEnum = | 'count' | 'rate' diff --git a/src/model/AnalyticsMetricsBreakdownResponseContext.ts b/src/model/AnalyticsMetricsBreakdownResponseContext.ts index be016a6..9a21f66 100644 --- a/src/model/AnalyticsMetricsBreakdownResponseContext.ts +++ b/src/model/AnalyticsMetricsBreakdownResponseContext.ts @@ -14,7 +14,7 @@ import AnalyticsAggregatedMetricsResponseContextTimeframe from './AnalyticsAggre export default class AnalyticsMetricsBreakdownResponseContext { /** - * Returns the metric you selected. + * Returns the metric and relevant parameters you selected. */ 'metric'?: AnalyticsMetricsBreakdownResponseContextMetricEnum; /** @@ -56,7 +56,20 @@ export type AnalyticsMetricsBreakdownResponseContextMetricEnum = | 'play-rate' | 'start' | 'end' - | 'impression'; + | 'impression' + | 'ccv-average' + | 'ccv-peak' + | 'unique-ccv-average' + | 'unique-ccv-peak' + | 'view-3' + | 'view-5' + | 'view-10' + | 'view-30' + | 'unique-view' + | 'unique-view-3' + | 'unique-view-5' + | 'unique-view-10' + | 'unique-view-30'; export type AnalyticsMetricsBreakdownResponseContextBreakdownEnum = | 'media-id' | 'media-type' diff --git a/src/model/AnalyticsMetricsOverTimeResponse.ts b/src/model/AnalyticsMetricsOverTimeResponse.ts index 7c11238..154806d 100644 --- a/src/model/AnalyticsMetricsOverTimeResponse.ts +++ b/src/model/AnalyticsMetricsOverTimeResponse.ts @@ -17,7 +17,7 @@ import Pagination from './Pagination.js'; export default class AnalyticsMetricsOverTimeResponse { 'context': AnalyticsMetricsOverTimeResponseContext; /** - * Returns an array of metrics and the timestamps . + * Returns an array of metrics and the timestamps. */ 'data': Array; 'pagination': Pagination; diff --git a/src/model/AnalyticsMetricsOverTimeResponseContext.ts b/src/model/AnalyticsMetricsOverTimeResponseContext.ts index 0f6af99..ba54746 100644 --- a/src/model/AnalyticsMetricsOverTimeResponseContext.ts +++ b/src/model/AnalyticsMetricsOverTimeResponseContext.ts @@ -14,7 +14,7 @@ import AnalyticsAggregatedMetricsResponseContextTimeframe from './AnalyticsAggre export default class AnalyticsMetricsOverTimeResponseContext { /** - * Returns the metric you selected. + * Returns the metric and relevant parameters you selected. */ 'metric'?: AnalyticsMetricsOverTimeResponseContextMetricEnum; /** @@ -56,7 +56,21 @@ export type AnalyticsMetricsOverTimeResponseContextMetricEnum = | 'play-rate' | 'start' | 'end' - | 'impression'; + | 'impression' + | 'ccv-average' + | 'ccv-peak' + | 'unique-ccv-average' + | 'unique-ccv-peak' + | 'view-3' + | 'view-5' + | 'view-10' + | 'view-30' + | 'unique-view' + | 'unique-view-3' + | 'unique-view-5' + | 'unique-view-10' + | 'unique-view-30'; export type AnalyticsMetricsOverTimeResponseContextIntervalEnum = + | 'minute' | 'hour' | 'day'; diff --git a/src/model/FilterBy.ts b/src/model/FilterBy.ts index a9d9e99..a15cc44 100644 --- a/src/model/FilterBy.ts +++ b/src/model/FilterBy.ts @@ -41,6 +41,10 @@ export default class FilterBy { * Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). */ 'tag'?: string; + /** + * Filters data based on the URL where the view is originating from. This filter parameter accepts an empty string to filter view events where no referrer is available. + */ + 'referrer'?: Array; static readonly discriminator?: string = undefined; @@ -93,6 +97,12 @@ export default class FilterBy { type: 'string', format: '', }, + { + name: 'referrer', + baseName: 'referrer', + type: 'Array', + format: 'uri', + }, ]; static getAttributeTypeMap(): Array { diff --git a/src/model/FilterBy1.ts b/src/model/FilterBy1.ts index 6c4aaa6..128b3de 100644 --- a/src/model/FilterBy1.ts +++ b/src/model/FilterBy1.ts @@ -41,6 +41,10 @@ export default class FilterBy1 { * Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). */ 'tag'?: string; + /** + * Filters data based on the URL where the view is originating from. This filter parameter accepts an empty string to filter view events where no referrer is available. + */ + 'referrer'?: Array; static readonly discriminator?: string = undefined; @@ -93,6 +97,12 @@ export default class FilterBy1 { type: 'string', format: '', }, + { + name: 'referrer', + baseName: 'referrer', + type: 'Array', + format: 'uri', + }, ]; static getAttributeTypeMap(): Array { diff --git a/src/model/FilterBy2.ts b/src/model/FilterBy2.ts index ca25a91..ace0a3a 100644 --- a/src/model/FilterBy2.ts +++ b/src/model/FilterBy2.ts @@ -41,6 +41,10 @@ export default class FilterBy2 { * Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). */ 'tag'?: string; + /** + * Filters data based on the URL where the view is originating from. This filter parameter accepts an empty string to filter view events where no referrer is available. + */ + 'referrer'?: Array; static readonly discriminator?: string = undefined; @@ -93,6 +97,12 @@ export default class FilterBy2 { type: 'string', format: '', }, + { + name: 'referrer', + baseName: 'referrer', + type: 'Array', + format: 'uri', + }, ]; static getAttributeTypeMap(): Array { diff --git a/test/payloads/analytics/getAggregatedMetrics/responses400-2.json b/test/payloads/analytics/getAggregatedMetrics/responses400-2.json new file mode 100644 index 0000000..d7d510f --- /dev/null +++ b/test/payloads/analytics/getAggregatedMetrics/responses400-2.json @@ -0,0 +1,7 @@ +{ + "type" : "https://docs.api.video/reference/request-invalid-query-parameter", + "title" : "A query parameter is invalid.", + "status" : 400, + "detail" : "This value should not contain more than 2048 characters.", + "name" : "filterBy[referrer]" +} \ No newline at end of file diff --git a/test/payloads/analytics/getAggregatedMetrics/responses400-3.json b/test/payloads/analytics/getAggregatedMetrics/responses400-3.json new file mode 100644 index 0000000..8199ab8 --- /dev/null +++ b/test/payloads/analytics/getAggregatedMetrics/responses400-3.json @@ -0,0 +1,7 @@ +{ + "type" : "https://docs.api.video/reference/request-invalid-query-parameter", + "title" : "A query parameter is invalid.", + "status" : 400, + "detail" : "This view duration is invalid. Use one of \"3s\", \"5s\", \"10s\", \"30s\".", + "name" : "viewDuration" +} \ No newline at end of file diff --git a/test/payloads/analytics/getMetricsBreakdown/responses400-2.json b/test/payloads/analytics/getMetricsBreakdown/responses400-2.json new file mode 100644 index 0000000..d7d510f --- /dev/null +++ b/test/payloads/analytics/getMetricsBreakdown/responses400-2.json @@ -0,0 +1,7 @@ +{ + "type" : "https://docs.api.video/reference/request-invalid-query-parameter", + "title" : "A query parameter is invalid.", + "status" : 400, + "detail" : "This value should not contain more than 2048 characters.", + "name" : "filterBy[referrer]" +} \ No newline at end of file diff --git a/test/payloads/analytics/getMetricsBreakdown/responses400-3.json b/test/payloads/analytics/getMetricsBreakdown/responses400-3.json new file mode 100644 index 0000000..8199ab8 --- /dev/null +++ b/test/payloads/analytics/getMetricsBreakdown/responses400-3.json @@ -0,0 +1,7 @@ +{ + "type" : "https://docs.api.video/reference/request-invalid-query-parameter", + "title" : "A query parameter is invalid.", + "status" : 400, + "detail" : "This view duration is invalid. Use one of \"3s\", \"5s\", \"10s\", \"30s\".", + "name" : "viewDuration" +} \ No newline at end of file diff --git a/test/payloads/analytics/getMetricsOverTime/responses400-2.json b/test/payloads/analytics/getMetricsOverTime/responses400-2.json new file mode 100644 index 0000000..f7c9d42 --- /dev/null +++ b/test/payloads/analytics/getMetricsOverTime/responses400-2.json @@ -0,0 +1,7 @@ +{ + "type" : "https://docs.api.video/reference/request-invalid-query-parameter", + "title" : "A query parameter is invalid.", + "status" : 400, + "detail" : "This interval is invalid. Use one of \"minute\", \"hour\", \"day\".", + "name" : "interval" +} \ No newline at end of file diff --git a/test/payloads/analytics/getMetricsOverTime/responses400-3.json b/test/payloads/analytics/getMetricsOverTime/responses400-3.json new file mode 100644 index 0000000..333be94 --- /dev/null +++ b/test/payloads/analytics/getMetricsOverTime/responses400-3.json @@ -0,0 +1,7 @@ +{ + "type" : "https://docs.api.video/reference/request-invalid-query-parameter", + "title" : "A query parameter is invalid.", + "status" : 400, + "detail" : "This interval cannot be used with a timeframe over 60 minutes.", + "name" : "interval" +} \ No newline at end of file diff --git a/test/payloads/analytics/getMetricsOverTime/responses400-4.json b/test/payloads/analytics/getMetricsOverTime/responses400-4.json new file mode 100644 index 0000000..d7d510f --- /dev/null +++ b/test/payloads/analytics/getMetricsOverTime/responses400-4.json @@ -0,0 +1,7 @@ +{ + "type" : "https://docs.api.video/reference/request-invalid-query-parameter", + "title" : "A query parameter is invalid.", + "status" : 400, + "detail" : "This value should not contain more than 2048 characters.", + "name" : "filterBy[referrer]" +} \ No newline at end of file diff --git a/test/payloads/analytics/getMetricsOverTime/responses400-5.json b/test/payloads/analytics/getMetricsOverTime/responses400-5.json new file mode 100644 index 0000000..8199ab8 --- /dev/null +++ b/test/payloads/analytics/getMetricsOverTime/responses400-5.json @@ -0,0 +1,7 @@ +{ + "type" : "https://docs.api.video/reference/request-invalid-query-parameter", + "title" : "A query parameter is invalid.", + "status" : 400, + "detail" : "This view duration is invalid. Use one of \"3s\", \"5s\", \"10s\", \"30s\".", + "name" : "viewDuration" +} \ No newline at end of file