All URIs are relative to https://api.mux.com
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 |
VideoViewResponse getVideoView(VIDEO_VIEW_ID).execute();
Get a Video View
Returns the details of a video view.
// Import classes:
import com.mux.ApiClient;
import com.mux.ApiException;
import com.mux.Configuration;
import com.mux.auth.*;
import com.mux.models.*;
import com.mux.sdk.VideoViewsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.mux.com");
// Configure HTTP basic authorization: accessToken
HttpBasicAuth accessToken = (HttpBasicAuth) defaultClient.getAuthentication("accessToken");
accessToken.setUsername("YOUR USERNAME");
accessToken.setPassword("YOUR PASSWORD");
VideoViewsApi apiInstance = new VideoViewsApi(defaultClient);
String VIDEO_VIEW_ID = "abcd1234"; // String | ID of the Video View
try {
VideoViewResponse result = apiInstance.getVideoView(VIDEO_VIEW_ID)
.execute();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling VideoViewsApi#getVideoView");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
VIDEO_VIEW_ID | String | ID of the Video View |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
ListVideoViewsResponse listVideoViews().limit(limit).page(page).viewerId(viewerId).errorId(errorId).orderDirection(orderDirection).filters(filters).metricFilters(metricFilters).timeframe(timeframe).execute();
List Video Views
Returns a list of video views which match the filters and have a `view_end` within the specified timeframe.
// Import classes:
import com.mux.ApiClient;
import com.mux.ApiException;
import com.mux.Configuration;
import com.mux.auth.*;
import com.mux.models.*;
import com.mux.sdk.VideoViewsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.mux.com");
// Configure HTTP basic authorization: accessToken
HttpBasicAuth accessToken = (HttpBasicAuth) defaultClient.getAuthentication("accessToken");
accessToken.setUsername("YOUR USERNAME");
accessToken.setPassword("YOUR PASSWORD");
VideoViewsApi apiInstance = new VideoViewsApi(defaultClient);
Integer limit = 25; // Integer | Number of items to include in the response
Integer page = 1; // Integer | Offset by this many pages, of the size of `limit`
String viewerId = "viewerId_example"; // String | Viewer ID to filter results by. This value may be provided by the integration, or may be created by Mux.
Integer errorId = 56; // Integer | 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.
String orderDirection = "orderDirection_example"; // String | Sort order.
java.util.List<String> filters = Arrays.asList(); // java.util.List<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`
java.util.List<String> metricFilters = Arrays.asList(); // java.util.List<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`
java.util.List<String> timeframe = Arrays.asList(); // java.util.List<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 {
ListVideoViewsResponse result = apiInstance.listVideoViews()
.limit(limit)
.page(page)
.viewerId(viewerId)
.errorId(errorId)
.orderDirection(orderDirection)
.filters(filters)
.metricFilters(metricFilters)
.timeframe(timeframe)
.execute();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling VideoViewsApi#listVideoViews");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
limit | Integer | Number of items to include in the response | [optional] [default to 25] |
page | Integer | Offset by this many pages, of the size of `limit` | [optional] [default to 1] |
viewerId | String | Viewer ID to filter results by. This value may be provided by the integration, or may be created by Mux. | [optional] |
errorId | Integer | 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] |
orderDirection | String | Sort order. | [optional] [enum: asc, desc] |
filters | java.util.List<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] |
metricFilters | java.util.List<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 | java.util.List<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] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |