Dimension API
This article provides sample API calls to manipulate Dimensions.
PREREQUISITES:
- Set up API access. NOTE: For the User API you must also enable User Management access.
- Verify that you have API access
- Obtain a token via a get token call since all API calls require a token
1. Fetch Dimension Information
Retrieve key data about specific Dimension.
- Item: dimension
- Method: GET
- ID: Specify ID of the dimension you need to get more information about
- Run request
1.1. Create Dimension
- Item: dimension
- Method: POST
- ID: Find an existing Dimension that you wish to use as a foundation for new Alert. To see the list of all Dimensions created in the system, select GET method, keep this field empty and Run request
- Define parameters of the new dimension
- Run Request
2. Fetch Dimension Value Information
Retrieve key data about specific Dimension.
- Item: dimension_value
- Method: GET
- ID: Specify ID of the Dimension Value you need to get more information about
- Run request
2.1. Create Dimension Value
- Item: dimension_value
- Method: POST
- ID: Find an existing Dimension Value that you wish to use as a foundation for new Alert. To see the list of all Dimension Values created in the system, select GET method, keep this field empty and Run request
- dimension: Specify ID of the Dimension where you need to create a new Value
- name / key_value_varchar: Define a descriptive name of a new Dimension value
- visible_in_dashboard: yes / no
- Run Request
2.2. Create Compound Dimension Value
API:
https://yourinstance.metricinsights.com/api/dimension_value
Header:
Accept:application/json
Token:UClCUUKxUlkdbhE1cHLz3kyjbIZYVh9eB34A5Q21Y3FPqKGSJs
POST body payload:
{
"dimension": "17",
"primary_dimension_value": "16345",
"secondary_dimension_value": "13560",
"visible_in_dashboard": "Yes"
}
Response:
{"dimension_value":{"dimension":"17","primary_dimension_value":"16345","secondary_dimension_value":"13560","visible_in_dashboard":"Yes"}}
3. Get all Dimension information (for Metric / Multi-metric / Report)
This API call can be used to get metric data along with all data related to all Dimension Value.
NOTE: Dimension Values are returned as dimension IDs.
- Item: metric_data / multimetric_data / report_data
- Method: GET
- element: (numeric value) Specify the ID of an you wish to get information about. Metric ID can be determined in the web browser URL of the Metric Viewer (Multi-Metric Viewer or Report Viewer). For example:
https://demo.metricinsights.com/chart/index/index/element/29
- all_dimension_values: "true". This parameter retrieves all data related to a specific dimension value
- API:
Dimensioned Metric - https://demo.metricinsights.com/api/metric_data?element=<metric_id>&all_dimension_value=true
Dimensioned Report - https://demo.metricinsights.com/api/report_data?element=<report_id>&all_dimension_value=true
Dimensioned Multi-metric - https://demo.metricinsights.com/api/multimetric_data?element=<multimetric_id>&all_dimension_value=true
6. Run request