-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathexercise-dimensions.php
More file actions
30 lines (26 loc) · 1022 Bytes
/
exercise-dimensions.php
File metadata and controls
30 lines (26 loc) · 1022 Bytes
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
<?php
require_once(__DIR__ . '/../assert.php');
require_once 'vendor/autoload.php';
// Authentication Setup
$config = MuxPhp\Configuration::getDefaultConfiguration()
->setUsername(getenv('MUX_TOKEN_ID'))
->setPassword(getenv('MUX_TOKEN_SECRET'));
// API Client Initialization
$dimensionsApi = new MuxPhp\Api\DimensionsApi(
new GuzzleHttp\Client(),
$config
);
// ========== list-filters ==========
$dimensions = $dimensionsApi->listDimensions();
assert($dimensions->getData() !== null);
assert($dimensions->getData()->getBasic() !== null);
assert($dimensions->getData()->getAdvanced() !== null);
print("list-dimensions OK ✅\n");
// ========== list-dimension-values ==========
$dimensionValues = $dimensionsApi->listDimensionValues("browser", [
"page" => 1,
"limit" => 25,
"timeframe" => ["7:days"]
]);
assert(is_array($dimensionValues->getData()));
print("list-dimension-values OK ✅\n");