All URIs are relative to https://api.mux.com, except if the operation defines another base path.
Method | HTTP request | Description |
---|---|---|
getVideoView() | GET /data/v1/video-views/{VIDEO_VIEW_ID} | Get a Video View |
listVideoViews() | GET /data/v1/video-views | List Video Views |
getVideoView($video_view_id): \MuxPhp\Models\VideoViewResponse
Get a Video View
Returns the details of a video view.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure HTTP basic authorization: accessToken
$config = MuxPhp\Configuration::getDefaultConfiguration()
->setUsername('YOUR_USERNAME')
->setPassword('YOUR_PASSWORD');
$apiInstance = new MuxPhp\Api\VideoViewsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$video_view_id = abcd1234; // string | ID of the Video View
try {
$result = $apiInstance->getVideoView($video_view_id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling VideoViewsApi->getVideoView: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
video_view_id | string | ID of the Video View |
\MuxPhp\Models\VideoViewResponse
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
listVideoViews($limit, $page, $viewer_id, $error_id, $order_direction, $filters, $metric_filters, $timeframe): \MuxPhp\Models\ListVideoViewsResponse
List Video Views
Returns a list of video views which match the filters and have a view_end
within the specified timeframe.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure HTTP basic authorization: accessToken
$config = MuxPhp\Configuration::getDefaultConfiguration()
->setUsername('YOUR_USERNAME')
->setPassword('YOUR_PASSWORD');
$apiInstance = new MuxPhp\Api\VideoViewsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$limit = 25; // int | Number of items to include in the response
$page = 1; // int | Offset by this many pages, of the size of `limit`
$viewer_id = 'viewer_id_example'; // string | Viewer ID to filter results by. This value may be provided by the integration, or may be created by Mux.
$error_id = 56; // int | Filter video views by the provided error ID (as returned in the error_type_id field in the list video views endpoint). If you provide any as the error ID, this will filter the results to those with any error.
$order_direction = 'order_direction_example'; // string | Sort order.
$filters = array('filters_example'); // string[] | Limit the results to rows that match conditions from provided key:value pairs. Must be provided as an array query string parameter. To exclude rows that match a certain condition, prepend a `!` character to the dimension. Possible filter names are the same as returned by the List Filters endpoint. Example: * `filters[]=operating_system:windows&filters[]=!country:US`
$metric_filters = array('metric_filters_example'); // string[] | Limit the results to rows that match inequality conditions from provided metric comparison clauses. Must be provided as an array query string parameter. Possible filterable metrics are the same as the set of metric ids, with the exceptions of `exits_before_video_start`, `unique_viewers`, `video_startup_failure_percentage`, `view_dropped_percentage`, and `views`. Example: * `metric_filters[]=aggregate_startup_time>=1000`
$timeframe = array('timeframe_example'); // string[] | Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. `timeframe[]=1498867200&timeframe[]=1498953600` * duration string e.g. `timeframe[]=24:hours or timeframe[]=7:days`
try {
$result = $apiInstance->listVideoViews($limit, $page, $viewer_id, $error_id, $order_direction, $filters, $metric_filters, $timeframe);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling VideoViewsApi->listVideoViews: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
limit | int | Number of items to include in the response | [optional] [default to 25] |
page | int | Offset by this many pages, of the size of `limit` | [optional] [default to 1] |
viewer_id | string | Viewer ID to filter results by. This value may be provided by the integration, or may be created by Mux. | [optional] |
error_id | int | Filter video views by the provided error ID (as returned in the error_type_id field in the list video views endpoint). If you provide any as the error ID, this will filter the results to those with any error. | [optional] |
order_direction | string | Sort order. | [optional] |
filters | string[] | Limit the results to rows that match conditions from provided key:value pairs. Must be provided as an array query string parameter. To exclude rows that match a certain condition, prepend a `!` character to the dimension. Possible filter names are the same as returned by the List Filters endpoint. Example: * `filters[]=operating_system:windows&filters[]=!country:US` | [optional] |
metric_filters | string[] | Limit the results to rows that match inequality conditions from provided metric comparison clauses. Must be provided as an array query string parameter. Possible filterable metrics are the same as the set of metric ids, with the exceptions of `exits_before_video_start`, `unique_viewers`, `video_startup_failure_percentage`, `view_dropped_percentage`, and `views`. Example: * `metric_filters[]=aggregate_startup_time>=1000` | [optional] |
timeframe | string[] | Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. `timeframe[]=1498867200&timeframe[]=1498953600` * duration string e.g. `timeframe[]=24:hours or timeframe[]=7:days` | [optional] |
\MuxPhp\Models\ListVideoViewsResponse
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]