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:

Table of contents:

  1. Access Admin > System > API Toolkit
  2. Get User's Element Views
  3. Simulate User View of Element

1. Access Admin > System > API Toolkit

2. Get User's Element Views

  1. Item: element_views
  2. Methods: GET
  3. Optionally, filter the returned data by assigning value to the following parameters:
    • element: The ID of the element
    • dimension_value: The Dimension Value
  4. Enter an API Token
  5. [Run request]
  6. The returned object contains an array of objects each of which contains information about a single viewed element
Example Response

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

Field Name Value Type Description
element_id string The ID of the viewed element.
segment_value_id string The segment value of the viewed element.
user_id string The ID of the user who viewed the element.
first_view_time string The date and time of the first view of the element.
last_view_time string The date and time of the last view of the element.
total_view_count string The number of times the element has been viewed.
name string The name of the element.

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.

  1. Item: element_views
  2. Methods: POST
  3. ID: Enter any number
  4. Select JSON request
  5. 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
  6. Enter an API Token
  7. [Run request]