Skip to content

Get Metric View Details by ID

API Description

Use this API to query metric view details by ID.

API URL

GET Http://{anymetrics_host:anymetrics_port}/anymetrics/api/v1/analysisview/query

For how to obtain anymetrics_host:anymetrics_port, see Calling APIs.

Request Parameters

Common Request Parameters (HEADERS)

Parameter Type Required Description
tenant-id String Yes The tenant ID that identifies the tenant where the metric view belongs
auth-type String Yes Authentication type. Supported values: UID, TOKEN, ACCOUNT, and APIKEY
auth-value String Yes The authentication value that corresponds to auth-type

How to Obtain Common Parameters

To obtain tenant-id, select a metric application in the top navigation bar of Aloudata CAN, choose API Integration from the left-side menu, and copy it from the API Integration page. Set auth-value to the authentication value that corresponds to the selected auth-type.

4.5 Request Parameters

Parameter Type Required Max Length Description
id int Yes Metric view ID

Response Parameters

Response Parameter Description

Parameter Type Required Max Length Description
code String Yes 32 API response code
message String Yes 512 Message body
traceId String Yes 128 Trace ID
data Array[Object] Yes Query results. For details, see data object parameters.

data Object Parameters

Parameter Type Required Max Length Description
id Long Yes Metric view ID
viewName String Yes 50 Metric view name
description String No 300 Metric view description
displayName String Yes Metric view display name
metrics Array[String] Yes Metric list
dimensions Array[String] No Dimension list
filters Array[String] No Filters
time_constraint String No Date range
orders Array[String] No Query sort rules. Referenced dimensions must be included in dimensions.

Request Example

http://127.0.0.1/anymetrics/api/v1/analysisview/query?id=1

Response Example

{
    "code": "200",
    "message": "Request succeeded",
    "traceId": "fdde6861bd554805998343f9ff2dcd70.292.16857691758642861",
    "data": [
        {
            "id": 1,
            "viewName": "OrderAnalysisView2",
            "description": "Order metric view 2",
            "metrics": [
                "orderCount"
            ],
            "dimensions": [
                "stories/category"
            ],
            "filters": [
                {
                    "name": "stories/isDraft",
                    "operator": "=",
                    "values": [
                        "No"
                    ]
                }
            ],
            "time_constraint":"BETWEEN 2023-01-01 AND  2023-01-10",
            "orders": [
                {
                    "stories/time": "asc"
                },
                {
                    "stories/count": "desc"
                }
            ]
        }
    ]
}