forked from brightcove-archive/ooyala_java-v2-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOoyalaApiTest.java
More file actions
43 lines (36 loc) · 1.65 KB
/
OoyalaApiTest.java
File metadata and controls
43 lines (36 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package com.ooyala.api;
import org.junit.Test;
import java.util.HashMap;
public class OoyalaApiTest {
private String API_KEY = "<insert-api-key-here>";
private String API_SECRET = "<insert-api-secret-here>";
@Test
public void testV2AccountPerformance() throws Exception {
OoyalaAPI ooyalaApiClient = new OoyalaAPI(API_KEY, API_SECRET);
Object performanceTotal = ooyalaApiClient.getRequest("analytics/reports/account/performance/total/2014-01-01...2014-05-01");
System.out.println(performanceTotal);
}
@Test
public void testV2AssetPerformance() throws Exception {
OoyalaAPI ooyalaApiClient = new OoyalaAPI(API_KEY, API_SECRET);
HashMap<String, String> params = new HashMap<String, String>();
params.put("limit", "25");
params.put("limit", "25");
params.put("limit", "25");
params.put("order_by", "plays");
Object performanceTotal = ooyalaApiClient.getRequest("/v2/analytics/reports/account/performance/cities/2013-05-01...2013-08-02", params);
System.out.println(performanceTotal);
}
@Test
public void testV3AnalyticsReport() throws Exception {
OoyalaAPI ooyalaApiClient = new OoyalaAPI(API_KEY, API_SECRET);
HashMap<String, String> params = new HashMap<String, String>();
params.put("report_type", "performance");
params.put("start_date", "2016-06-01");
params.put("end_date", "2016-06-02");
params.put("limit", "25");
params.put("order_by", "plays");
Object performanceTotal = ooyalaApiClient.getRequest("/v3/analytics/reports", params);
System.out.println(performanceTotal);
}
}