Operations involving dimensions
- list - List the dimensions
- listFilterValues - List the filter values for a dimension
Retrieves a list of dimensions that can be used as query parameters across various data endpoints. Each dimension has a unique id that can be used to filter data effectively.
The dimensions retrieved from this endpoint can be used in conjunction with the list video views and list by top content endpoints to filter results based on specific criteria. For example, you can filter views by browser_name, os_name, device_type, and more.
Related guides: What Video Data do we capture? , Use passable dimensions
Note: In the examples below,
package hello.world;is used for demonstration purposes. When creating your own Java files, ensure the package name matches your directory structure (e.g., if your file is atsrc/main/java/com/example/MyApp.java, usepackage com.example;).
// Package declaration - adjust to match your project's directory structure
package hello.world;
// Import required classes from the FastPix SDK
import java.lang.Exception;
import com.fasterxml.jackson.databind.SerializationFeature;
import io.fastpix.sdk.FastPixSDK;
import io.fastpix.sdk.models.components.Security;
import io.fastpix.sdk.models.operations.ListDimensionsResponse;
import io.fastpix.sdk.utils.JSON;
public class Application {
public static void main(String[] args) throws Exception {
FastPixSDK sdk = FastPixSDK.builder()
.security(Security.builder()
.username("your-access-token")
.password("your-secret-key")
.build())
.build();
ListDimensionsResponse res = sdk.dimensions().list()
.call();
if (res.object().isPresent()) {
var mapper = JSON.getMapper();
mapper.enable(SerializationFeature.INDENT_OUTPUT);
System.out.println(mapper.writeValueAsString(res.object().get()));
}
}
}| Error Type | Status Code | Content Type |
|---|---|---|
| models/errors/APIException | 4XX, 5XX | */* |
This endpoint returns the filter values associated with a specific dimension, along with the total number of video views for each value. For example, it can list all browser_name (dimension) and show how many views occurred for all available browsers like Chrome, Safari (filter values).
In order to use the Custom Dimensions, you must enable them in the dashboard under settings option based on the plan you have opted for.
A developer wants to know how their video content performs across different browsers. By calling this endpoint for the device_type dimension, they can retrieve a breakdown of video views by each device (for example, Desktop, Mobile, Tablet). This data helps the developer understand where optimizations or troubleshooting is necessary.
Related guide: Filters and timespan
// Package declaration - adjust to match your project's directory structure
package hello.world;
// Import required classes from the FastPix SDK
import java.lang.Exception;
import com.fasterxml.jackson.databind.SerializationFeature;
import io.fastpix.sdk.FastPixSDK;
import io.fastpix.sdk.models.components.Security;
import io.fastpix.sdk.models.operations.*;
import io.fastpix.sdk.utils.JSON;
public class Application {
public static void main(String[] args) throws Exception {
FastPixSDK sdk = FastPixSDK.builder()
.security(Security.builder()
.username("your-access-token")
.password("your-secret-key")
.build())
.build();
ListFilterValuesForDimensionResponse res = sdk.dimensions().listFilterValues()
.dimensionsId(DimensionsId.BROWSER_NAME)
.timespan(ListFilterValuesForDimensionTimespan.TWENTY_FOURHOURS)
.filterby("browser_name:Chrome")
.call();
if (res.object().isPresent()) {
var mapper = JSON.getMapper();
mapper.enable(SerializationFeature.INDENT_OUTPUT);
System.out.println(mapper.writeValueAsString(res.object().get()));
}
}
}| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
dimensionsId |
DimensionsId | ✔️ | Pass Dimensions Id |
browser_name |
timespan |
Optional<ListFilterValuesForDimensionTimespan> | ➖ | This parameter specifies the time span between which the video views list must be retrieved by. You can provide either from and to unix epoch timestamps or time duration. The scope of duration is between 60 minutes to 30 days. Accepted formats are: array of epoch timestamps for example timespan[]=1498867200×pan[]=1498953600duration string for example timespan[]=24:hours or timespan[]=7:days |
24:hours |
filterby |
Optional<String> | ➖ | Pass the dimensions and their corresponding values you want to filter the views by. For excluding the values in the filter we can pass "!" before the filter value. The list of filters can be obtained from list of dimensions endpoint. Example Values : [ browser_name:Chrome , os_name:macOS , !device_name:Galaxy ] |
browser_name:Chrome |
ListFilterValuesForDimensionResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| models/errors/APIException | 4XX, 5XX | */* |