Tags

Retrieve Tags List

GET /_config/tags/_list

Description Retrieve the list of tags associated with a specific monitor.

HTTP Method GET

Endpoint /_config/tags/_list

Request Header Authorization Basic <token>

Request Parameters

Query Parameters

  • monitor_id (string, required if asset_id is not provided): The ID of the monitor for which you want to retrieve the list of tags.

  • asset_id (string, required if monitor_id is not provided): The ID of the asset for which you want to retrieve the list of tags.

Note: Either monitor_id or asset_id must be provided. The request will fail if both are missing or have invalid values.

Sample Request

  • Case 1: Request using monitor_id

    curl --location 'https://app.4pointx.com/_config/tags/_list?monitor_id=0284f035-2647-4316-9aca-c4a26d442221' \
        --header 'Authorization: Basic <token>' \
        --data ''
    
  • Case 2: Request using asset_id

    curl --location 'https://app.4pointx.com/_config/tags/_list?asset_id=bae00bb8-4221-47cb-8fa8-78fd3d7df9fb' \
        --header 'Authorization: Basic <token>' \
        --data ''
    

Sample Response

Success

  • Case 1: Request using monitor_id

    • If monitor type is Condition

      [
        {
            "tag_unit": "",
            "tag_id": "velocity_x_0284f035-2647-4316-9aca-c4a26d442221",
            "tag_name": "velocity_x",
            "tag_desc": "",
            "thresholds": {
              "operational": "0.5",
              "warning": "11.5",
              "caution": "4.5"
          }
        },
        {
            "tag_unit": "",
            "tag_id": "velocity_y_0284f035-2647-4316-9aca-c4a26d442221",
            "tag_name": "velocity_y",
            "tag_desc": "",
            "thresholds": {
              "operational": "0.5",
              "warning": "11.5",
              "caution": "4.5"
          }
        },
        {
            "tag_unit": "",
            "tag_id": "velocity_z_0284f035-2647-4316-9aca-c4a26d442221",
            "tag_name": "velocity_z",
            "tag_desc": "",
            "thresholds": {
              "operational": "0.5",
              "warning": "11.5",
              "caution": "4.5"
          }
        }
      ]
      
    • for other monitor types

      [
        {
            "tag_unit": "",
            "tag_id": "velocity_x_0284f035-2647-4316-9aca-c4a26d442221",
            "tag_name": "velocity_x",
            "tag_desc": ""
        },
        {
            "tag_unit": "",
            "tag_id": "velocity_y_0284f035-2647-4316-9aca-c4a26d442221",
            "tag_name": "velocity_y",
            "tag_desc": ""
        },
        {
            "tag_unit": "",
            "tag_id": "velocity_z_0284f035-2647-4316-9aca-c4a26d442221",
            "tag_name": "velocity_z",
            "tag_desc": ""
        }
      ]
      
  • Case 2: Request using asset_id

    [
      {
          "label": "Tecom Monitor",
          "type": "condition-monitor",
          "isGroupLabel": true
      },
      {
          "id": "displacement_x_04cedac0-f2b3-48f7-a282-6727c6a54f69",
          "label": "displacement_x"
      },
      {
          "id": "velocity_z_04cedac0-f2b3-48f7-a282-6727c6a54f69",
          "label": "velocity_z"
      }
      {
          "label": "Sim Monitor 1",
          "type": "condition-monitor",
          "isGroupLabel": true
      },
      {
          "id": "acceleration_x_c2ec5ab0-0f56-4a3d-889a-0f4dbd834b81",
          "label": "acceleration_x"
      },
      {
          "id": "acceleration_y_c2ec5ab0-0f56-4a3d-889a-0f4dbd834b81",
          "label": "acceleration_y"
      },
      {
          "id": "acceleration_z_c2ec5ab0-0f56-4a3d-889a-0f4dbd834b81",
          "label": "acceleration_z"
      }
    ]
    
  • for other monitor types

    [
      {
          "tag_name": "L_R2_R2TRLFCE",
          "tag_desc": "R2 Total Rolling Force",
          "tag_unit": "kN",
          "tag_id": "L_R2_R2TRLFCE_2a2051d1-4a22-44ea-9851-eec177095d6b"
      },
      {
          "tag_name": "L_R2_R2DIFRLFCE",
          "tag_desc": "R2 Differential Rolling Force (OS-DS)",
          "tag_unit": "kN",
          "tag_id": "L_R2_R2DIFRLFCE_2a2051d1-4a22-44ea-9851-eec177095d6b"
      }
    

    ]

Error

{
  "error": {
    "status": 401,
    "message": "You do not have access to this module"
  }
}
{
  "error": {
    "status": 400,
    "message":  "No tags found for Monitor ID: 4f035-26298347-4316-9aca-c4a21"
  }
}
{
  "error": {
    "status": 400,
    "message":  "No tags found for Asset ID: 547618d4-c481-48e5-b2a0-ae810a94883a"
  }
}

Retrieve Tags Count

GET /_config/tags/_count

Description Retrieve the total count of tags for functions and pipelines.

HTTP Method GET

Endpoint /_config/tags/_count

Request Header Authorization Basic <token>

Request Parameters

Query Parameters

  • pipeline_id (string, required if function_id is not provided): The ID of the pipeline for which you want to retrieve the total tag count.

  • function_id (string, required if pipeline_id is not provided): The ID of the function for which you want to retrieve the total tag count.

Note: Either pipeline_id or function_id must be provided. The request will fail if both are missing or have invalid values.

Sample Request

curl --location 'https://app.4pointx.com/_config/tags/_count?function_id=3626c23b-2070-48bb-baaa-1170a39c0f88' \
     --header 'Authorization: Basic <token>' \
     --data ''

Sample Response

Success

24

Error

{
  "error": {
    "status": 401,
    "message": "You do not have access to this module"
  }
}
{
  "error": {
    "status": 400,
    "message":  "Insufficient inputs"
  }
}
{
  "error": {
    "status": 400,
    "message": "Excess inputs"
  }
}

Query Tags Trend

POST /_config/tags/_trend

Description Query the tag trend data over a specified time range.

HTTP Method POST

Endpoint /_config/tags/_trend

Request Header Authorization Basic <token>

Request Parameters

Note - Either monitor_id (in the query parameters) or tags (in the request body) must be provided. If neither is specified, the request will be rejected.

Query Parameters

  • from (string, required): The start time for the trend data.

  • to (string, required): The end time for the trend data.

  • agg_func (string, optional): The aggregation function to apply to tag values (default: “avg”)(values: sum, value_count, max, min, etc).

  • agg_interval (string, optional): The aggregation interval for trend data (Values: in days, months, years).

  • monitor_id (string, required if tags is not provided): The ID of the monitor for which you want to retrieve the trend data.

Body Parameters

  • tags (string, required if monitor_id is not provided): A comma-separated list of tag IDs for which you want to retrieve the trend data.

Sample Request

  • Case 1: Request using monitor_id as URL parameter

curl --location 'https://app.4pointx.com/_config/tags/_trend?from=2024-05-16T09:00:00.000Z&to=2024-05-23T09:45:00.000Z&agg_func=avg&agg_interval=10m&monitor_id=0a122440-985a-4a4a-b9e8-b2108fa086f2' \
    --header 'Authorization: Basic <token>' \
    --data '{}'
  • Case 2: Request using tags as body parameter

In this scenario, tags from different monitors can be input but monitor_id MUST not be specified.

curl --location 'https://app.4pointx.com/_config/tags/_trend?from=2024-05-16T09:00:00.000Z&to=2024-05-23T09:45:00.000Z&agg_func=avg&agg_interval=10m' \
    --header 'Authorization: Basic <token>' \
    --data '{
              "tags": ["acceleration_x_09689c6b-10f9-49d9-bba8-5c53a1686bf0",
                        "acceleration_y_09689c6b-10f9-49d9-bba8-5c53a1686bf0",
                        "acceleration_z_09689c6b-10f9-49d9-bba8-5c53a1686bf0",
                        "displacement_x_09689c6b-10f9-49d9-bba8-5c53a1686bf0",
                        "displacement_y_09689c6b-10f9-49d9-bba8-5c53a1686bf0",
                        "displacement_z_09689c6b-10f9-49d9-bba8-5c53a1686bf0",
                        "temperature_09689c6b-10f9-49d9-bba8-5c53a1686bf0",
                        "velocity_x_0a122440-985a-4a4a-b9e8-b2108fa086f2",
                        "velocity_y_0a122440-985a-4a4a-b9e8-b2108fa086f2",
                        "velocity_z_0a122440-985a-4a4a-b9e8-b2108fa086f2",
                        "acceleration_x_0a122440-985a-4a4a-b9e8-b2108fa086f2"]
              }'
  • Case 3: Request using both monitor_id as URL parameter and tags as body parameter

In this scenario, ensure that all tags are associated with the given monitor_id.

curl --location 'https://app.4pointx.com/_config/tags/_trend?from=2024-05-16T09:00:00.000Z&to=2024-05-23T09:45:00.000Z&agg_func=avg&agg_interval=10m&monitor_id=0a122440-985a-4a4a-b9e8-b2108fa086f2' \
    --header 'Authorization: Basic <token>' \
    --data '{
              "tags": ["acceleration_x_0a122440-985a-4a4a-b9e8-b2108fa086f2",
                        "acceleration_y_0a122440-985a-4a4a-b9e8-b2108fa086f2",
                        "acceleration_z_0a122440-985a-4a4a-b9e8-b2108fa086f2",
                        "displacement_x_0a122440-985a-4a4a-b9e8-b2108fa086f2",
                        "displacement_y_0a122440-985a-4a4a-b9e8-b2108fa086f2"]
              }'
  • Case 4: Request using tags as body parameter and without aggregation

In this scenario, monitor_id is optional but if used, the tags must adhere to conditions in Case 3.

curl --location 'https://app.4pointx.com/_config/tags/_trend?from=2024-05-16T09:00:00.000Z&to=2024-05-23T09:45:00.000Z' \
    --header 'Authorization: Basic <token>' \
    --data '{
              "tags": ["acceleration_x_09689c6b-10f9-49d9-bba8-5c53a1686bf0",
                        "velocity_y_0a122440-985a-4a4a-b9e8-b2108fa086f2",
                        "velocity_z_0a122440-985a-4a4a-b9e8-b2108fa086f2",
                        "acceleration_x_0a122440-985a-4a4a-b9e8-b2108fa086f2"]
              }'

Sample Response

Success

Case 1

All tags in specified monitor_id are returned based on the time range and aggregation function. Note that if some tags might not have data for a particuar time and in such scenario, those tags will be missing in some time bins.

[
  {
    "timestamp": "2024-05-23T09:30:00.000Z",
    "acceleration_x_0a122440-985a-4a4a-b9e8-b2108fa086f2": 377.41913561551075,
    "acceleration_y_0a122440-985a-4a4a-b9e8-b2108fa086f2": 435.29252250239534,
    "acceleration_z_0a122440-985a-4a4a-b9e8-b2108fa086f2": 378.2721168949919,
    "displacement_x_0a122440-985a-4a4a-b9e8-b2108fa086f2": 400.27624626879424,
    "displacement_y_0a122440-985a-4a4a-b9e8-b2108fa086f2": 381.3254570151275,
    "displacement_z_0a122440-985a-4a4a-b9e8-b2108fa086f2": 434.5962147262861,
    "temperature_0a122440-985a-4a4a-b9e8-b2108fa086f2": 399.9745633107311,
    "velocity_x_0a122440-985a-4a4a-b9e8-b2108fa086f2": 409.2890699854437,
    "velocity_y_0a122440-985a-4a4a-b9e8-b2108fa086f2": 402.9165139828088,
    "velocity_z_0a122440-985a-4a4a-b9e8-b2108fa086f2": 425.60913431419516
  },
  {
    "timestamp": "2024-05-23T09:40:00.000Z",
    "acceleration_x_0a122440-985a-4a4a-b9e8-b2108fa086f2": 392.14057741326803,
    "acceleration_y_0a122440-985a-4a4a-b9e8-b2108fa086f2": 406.845869678562,
    "acceleration_z_0a122440-985a-4a4a-b9e8-b2108fa086f2": 396.3273116289559,
    "displacement_x_0a122440-985a-4a4a-b9e8-b2108fa086f2": 395.647922580525,
    "displacement_y_0a122440-985a-4a4a-b9e8-b2108fa086f2": 396.3469284833488,
    "displacement_z_0a122440-985a-4a4a-b9e8-b2108fa086f2": 387.1515081373312,
    "temperature_0a122440-985a-4a4a-b9e8-b2108fa086f2": 406.6904141700874,
    "velocity_x_0a122440-985a-4a4a-b9e8-b2108fa086f2": 358.4152575993942,
    "velocity_y_0a122440-985a-4a4a-b9e8-b2108fa086f2": 396.6618610963983,
    "velocity_z_0a122440-985a-4a4a-b9e8-b2108fa086f2": 377.41961540610106
  }
]

Case 2

All specified tags are returned based on the time range and aggregation function.

[
  {
    "timestamp": "2024-05-23T09:30:00.000Z",
    "acceleration_x_09689c6b-10f9-49d9-bba8-5c53a1686bf0": 109.41913561551075,
    "acceleration_y_09689c6b-10f9-49d9-bba8-5c53a1686bf0": 389.29252250239534,
    "acceleration_z_09689c6b-10f9-49d9-bba8-5c53a1686bf0": 493.2721168949919,
    "displacement_x_09689c6b-10f9-49d9-bba8-5c53a1686bf0": 550.27624626879424,
    "displacement_y_09689c6b-10f9-49d9-bba8-5c53a1686bf0": 121.3254570151275,
    "displacement_z_09689c6b-10f9-49d9-bba8-5c53a1686bf0": 564.5962147262861,
    "temperature_09689c6b-10f9-49d9-bba8-5c53a1686bf0": 769.9745633107311,
    "velocity_x_0a122440-985a-4a4a-b9e8-b2108fa086f2": 409.2890699854437,
    "velocity_y_0a122440-985a-4a4a-b9e8-b2108fa086f2": 402.9165139828088,
    "velocity_z_0a122440-985a-4a4a-b9e8-b2108fa086f2": 425.60913431419516,
    "acceleration_x_0a122440-985a-4a4a-b9e8-b2108fa086f2": 377.41913561551075
  },
  {
    "timestamp": "2024-05-23T09:40:00.000Z",
    "acceleration_x_09689c6b-10f9-49d9-bba8-5c53a1686bf0": 667.81823561238906,
    "acceleration_y_09689c6b-10f9-49d9-bba8-5c53a1686bf0": 455.22232250239534,
    "acceleration_z_09689c6b-10f9-49d9-bba8-5c53a1686bf0": 458.12222168949919,
    "displacement_x_09689c6b-10f9-49d9-bba8-5c53a1686bf0": 230.27624626879424,
    "displacement_y_09689c6b-10f9-49d9-bba8-5c53a1686bf0": 221.32545567890549,
    "displacement_z_09689c6b-10f9-49d9-bba8-5c53a1686bf0": 454.5962147262861,
    "temperature_09689c6b-10f9-49d9-bba8-5c53a1686bf0": 155.6719230207311,
    "velocity_x_0a122440-985a-4a4a-b9e8-b2108fa086f2": 358.4152575993942,
    "velocity_y_0a122440-985a-4a4a-b9e8-b2108fa086f2": 396.6618610963983,
    "velocity_z_0a122440-985a-4a4a-b9e8-b2108fa086f2": 377.41961540610106,
    "acceleration_x_0a122440-985a-4a4a-b9e8-b2108fa086f2": 392.14057741326803
  }
]

Case 3

Only specified tags for given monitor_id are returned based on the time range and aggregation function.

[
  {
    "timestamp": "2024-05-23T09:30:00.000Z",
    "acceleration_x_0a122440-985a-4a4a-b9e8-b2108fa086f2": 377.41913561551075,
    "acceleration_y_0a122440-985a-4a4a-b9e8-b2108fa086f2": 435.29252250239534,
    "acceleration_z_0a122440-985a-4a4a-b9e8-b2108fa086f2": 378.2721168949919,
    "displacement_x_0a122440-985a-4a4a-b9e8-b2108fa086f2": 400.27624626879424,
    "displacement_y_0a122440-985a-4a4a-b9e8-b2108fa086f2": 381.3254570151275
  },
  {
    "timestamp": "2024-05-23T09:40:00.000Z",
    "acceleration_x_0a122440-985a-4a4a-b9e8-b2108fa086f2": 392.14057741326803,
    "acceleration_y_0a122440-985a-4a4a-b9e8-b2108fa086f2": 406.845869678562,
    "acceleration_z_0a122440-985a-4a4a-b9e8-b2108fa086f2": 396.3273116289559,
    "displacement_x_0a122440-985a-4a4a-b9e8-b2108fa086f2": 395.647922580525,
    "displacement_y_0a122440-985a-4a4a-b9e8-b2108fa086f2": 396.3469284833488,
  }
]

Case 4

Raw vales for all tags either based on monitor or not are returned based on the time range.

[
  {"timestamp": "2024-05-23T09:30:00.000Z", "acceleration_x_09689c6b-10f9-49d9-bba8-5c53a1686bf0": 109.41913561551075, "velocity_y_0a122440-985a-4a4a-b9e8-b2108fa086f2": 402.9165139828088, "velocity_z_0a122440-985a-4a4a-b9e8-b2108fa086f2": 425.60913431419516, "acceleration_x_0a122440-985a-4a4a-b9e8-b2108fa086f2": 377.41913561551075},
  {"timestamp": "2024-05-23T09:40:00.000Z", "acceleration_x_09689c6b-10f9-49d9-bba8-5c53a1686bf0": 667.81823561238906, "velocity_y_0a122440-985a-4a4a-b9e8-b2108fa086f2": 396.6618610963983, "velocity_z_0a122440-985a-4a4a-b9e8-b2108fa086f2": 377.41961540610106, "acceleration_x_0a122440-985a-4a4a-b9e8-b2108fa086f2": 392.14057741326803}
]

Error

{
  "error": {
    "status": 401,
    "message": "You do not have access to this module"
  }
}
{
  "error": {
    "status": 400,
    "message":  "Insufficient inputs"
  }
}
{
  "error": {
      "status": 400,
      "message": {
          "error": "The following tags are not associated with monitor ID 0a122440-985a-4a4a-b9e8-b2108fa086f2: ['velocity_x_09689c6b-10f9-49d9-bba8-5c53a1686bf0']"
      }
  }
}
{
  "error": {
    "status": 400,
    "message": "Error: <message>"
  }
}