Counting Data API [Beta]

 

Description Calling this endpoint by providing the type of counting data & query payload object in JSON string to get counting data in JSON format.
Endpoint

{CubeHostAddress}/API/v1/load

{CubeHostAddress}: https://cube.footfallcam.com (if you're using on-premise solution, please consult FootfallCam Support on the host address)


Method POST
Headers
  1. Authorization : Token value return from API 'GenerateAccessToken' by providing the user name & password
Body - JSON Example {
    "query": {
        "measures": [
            "ThisCubeName.FC01_SUM",
            "ThisCubeName.FC01_AVG",
            "ThisCubeName.FC02_SUM",
            "ThisCubeName.FC02_AVG"
        ],
        "timeDimensions": [
            {
                "dimension": "ThisCubeName.Time",
                "dateRange": [
                    "2021-10-01T10:00:00.000",
                    "2021-10-31"
                ],
                "granularity": "hour"
            }
        ],
        "order": [
            [
                "ThisCubeName.FC01_SUM",
                "desc"
            ]
        ],
        "filters": [
            {
                "member": "ThisCubeName.CompanyId",
                "operator": "equals",
                "values": [
                    "1001"
                ]
            },
            {
                "member": "ThisCubeName.BranchId",
                "operator": "equals",
                "values": [
                    "2001",
                    "2001"
                ]
            },
            {
                "member": "ThisCubeName.BranchName",
                "operator": "equals",
                "values": [
                    "BranchName1",
                    "BranchName2"
                ]
            },
            {
                "member": "ThisCubeName.AreaId",
                "operator": "equals",
                "values": [
                    "3001",
                    "3002",
                    "3003"
                ]
            }
        ],
        "dimensions": [
            "ThisCubeName.CompanyId",
            "ThisCubeName.CompanyName",
            "ThisCubeName.BranchId",
            "ThisCubeName.BranchName",
            "ThisCubeName.AreaId",
            "ThisCubeName.AreaName"
        ],
        "limit" : 50000
    }
}
Body Description

Cube name must be mentioned in payload and its available fields depends on cube selected. Please refer list of cube for cube details

  1. query (object) : To define payload for query data
  2. measures (list of string) : To define list of metric codes and type of aggregation.
  3. timeDimensions (list of object) : Contains an object to define time related parameters
    1. dimension (string) : To specify dimension for applying time related parameters
    2. dateRange (list of string) : To specify start and end date time for data query. Example: "2021-10-01T10:00:00.000", "2021-10-31"
    3. granularity (string) : To define time granularity for data. Example: minute, hour, day, week, month, year
  4. order (list of list of string) : To specify ordering of data. Each minor list contains field name to apply ordering and respective type of ordering. Example : ["ThisCubeName.FC01_SUM", "desc"]
  5. filters (list of object) : To define filtering of query data.
    1. member (string) : To specify dimension for applying filter.
    2. operator (string) : To define type for filter. Example: equals, notEquals, contains, notContains
    3. values (list of string) : To specify value for filtering data.
  6. dimensions (list of string) : To specify dimension to display in result data, similar to 'Select' statement in SQL query.
  7. limit (int, optional) : To specify maximum record count of data returned. Default value will be 10000 (if not specified in payload), maximum value is 50000.
Response 1 - JSON Example {
    "error": "Continue wait",
    "stage": {
        "stage": "Executing query",
        "timeElapsed": 5003
    }
}
Response 1 Description The 'Continue Wait' response simply an indication that the backend may takes sometime to execute the query and return result. It is not due to failed API call, the query is executing at backend. Retry afterward and the API will return result once the backend finish execute the query.
Response 2 - JSON Example {
    "query": {},
    "data": [
{
            "cube3.CompanyId": "18330",
            "cube3.CompanyName": "DemoCompany",
            "cube3.BranchId": "23097",
            "cube3.BranchName": "UKSite01",
            "cube3.AreaId": "-1",
            "cube3.AreaName": null,
            "cube3.Time.hour": "2022-01-15T11:00:00.000",
            "cube3.Time": "2022-01-15T11:00:00.000",
            "cube3.FC01_SUM": 200,
            "cube3.FC01_MAX": 180,
            "cube3.FC01_AVG": 100,
            "cube3.FC01_MIN": 20,
            "cube3.FC02_SUM": 188,
            "cube3.FC02_MAX": 171,
            "cube3.FC02_AVG": 94,
            "cube3.FC02_MIN": 17
        },
        {
            "cube3.CompanyId": "18330",
            "cube3.CompanyName": "DemoCompany",
            "cube3.BranchId": "23097",
            "cube3.BranchName": "UKSite01",
            "cube3.AreaId": "-1",
            "cube3.AreaName": null,
            "cube3.Time.hour": "2022-01-07T15:00:00.000",
            "cube3.Time": "2022-01-07T15:00:00.000",
            "cube3.FC01_SUM": 175,
            "cube3.FC01_MAX": 100,
            "cube3.FC01_AVG": 87.5,
            "cube3.FC01_MIN": 75,
            "cube3.FC02_SUM": 174,
            "cube3.FC02_MAX": 95,
            "cube3.FC02_AVG": 87,
            "cube3.FC02_MIN": 79
        },
        {
            "cube3.CompanyId": "18330",
            "cube3.CompanyName": "DemoCompany",
            "cube3.BranchId": "23097",
            "cube3.BranchName": "UKSite01",
            "cube3.AreaId": "-1",
            "cube3.AreaName": null,
            "cube3.Time.hour": "2022-01-15T13:00:00.000",
            "cube3.Time": "2022-01-15T13:00:00.000",
            "cube3.FC01_SUM": 171,
            "cube3.FC01_MAX": 151,
            "cube3.FC01_AVG": 85.5,
            "cube3.FC01_MIN": 20,
            "cube3.FC02_SUM": 166,
            "cube3.FC02_MAX": 146,
            "cube3.FC02_AVG": 83,
            "cube3.FC02_MIN": 20
        }
],
    "lastRefreshTime": "2022-01-19T07:35:41.259Z",
    "refreshKeyValues": [
        [
            {
                "refresh_key": "13688147"
            }
        ]
    ],
    "usedPreAggregations": {},
    "transformedQuery": {},
    "requestId": "dda53bef-4d52-4377-aee8-74d2976cafc6-span-1",
    "annotation": {},
    "dataSource": "default",
    "dbType": "prestodb",
    "extDbType": "cubestore",
    "external": false,
    "slowQuery": false
}
Response 2 Description Counting data result will be in 'data' section as list of objects, other additional information may be remove in future.
Updated on October 28, 2024