Skip to content

Create a Category

API Description

Use this API to create a metric category or dimension category in the metric platform.

API URL

POST Http://{anymetrics_host:anymetrics_port}/anymetrics/api/v1/category/create

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

Request Method

Common Request Parameters (HEADERS)

Parameter Type Required Description
tenant-id String Yes Tenant ID, which identifies the tenant that owns the metric query content.
auth-type String Yes Authentication method. Supported values: UID, TOKEN, ACCOUNT, APIKEY.
auth-value String Yes Authentication value corresponding to auth-type.

How to Obtain Common Parameters

To obtain tenant-id, select Metric Application from the top navigation bar in Aloudata CAN, then select API Integration from the left menu. Enter auth-value according to the selected auth-type.

Request Parameters

Parameter Type Required Max Length Description
name String Yes 32 Category name.
categoryType String Yes 32 Category type.
Metric category: CATEGORY_METRIC
Dimension category: CATEGORY_DIMENSION
Dataset category: CATEGORY_DATASET
parentId String No 64 Parent category ID. Optional. Used to build the category hierarchy.
frontId String No 64 Previous category ID.

Response Parameters

Parameter Type Required Max Length Description
code String Yes 32 API response code.
message String Yes 512 Message body.
traceId String Yes 128 Request trace ID, used for troubleshooting and log correlation.
errorMsg String Yes Error message.
detailErrorMsg String Yes Detailed error message.
data String Yes 64 Unique ID of the newly created category, used for subsequent operations.

Request Example

{
    "name":"API-created Category 01",
    "categoryType":"CATEGORY_METRIC",
    "parentId":null,
    "frontId":null
}

Response Example

{
  "data":"f88e7b90-bcff-4d48-85be-967ab77a2ed5",
  "success":true,
  "code":200,
  "errorMsg":null,
  "traceId":"b6bbdc8f33f642de9a250e690238bdff.254.17067705870260001"
}