Element Views API
The /api/element_views
endpoint supports two methods:
- GET: Returns information about all the elements and element dimensions that the user executing the API call has viewed.
- POST: Increases element's view count by 1, simulating a user view.
Prerequisites:
- Set up API access
- Verify that you have API access and obtain a token via get_token call
Table of contents:
1. Access Admin > System > API Toolkit
2. Get User's Element Views
- Item: element_views
- Methods: GET
- Optionally, filter the returned data by assigning value to the following parameters:
-
element
: The ID of the element -
dimension_value
: The Dimension Value
-
- Enter an API Token
- [Run request]
- The returned object contains an array of objects each of which contains information about a single viewed element
- See Example Response and Fields Description for details
This example demonstrates an object which represents a viewed element.
{
"element_id": "122331",
"segment_value_id": "0",
"user_id": "118",
"first_view_time": "2022-06-20 07:27:59",
"last_view_time": "2024-04-19 15:19:11",
"total_view_count": "7",
"name": "External report Microsoft Power BI Cloud"
}
Fields Description
3. Simulate User View of Element
This request allows to simulate a user view for an element.
NOTE: The System Variable ELEMENT_VIEW_LOG_FREQ_TIME_SEC, controls the minimum interval required between two views of the same element by a user for the second view to be counted. The default value is 900 seconds.
- Item: element_views
- Methods: POST
- ID: Enter any number
- Select JSON request
- Provide values for the following parameters:
-
element
: The ID of the element -
dimension_value
: The Dimension Value, set to "0" if it is not needed
-
- Enter an API Token
- [Run request]