Monitors

Create a Monitor

POST /_config/monitors/

Description This endpoint allows you to create a new monitor.

HTTP Method POST

Endpoint: /_config/monitors/

Request Header Authorization Basic <token>

Request Parameters

Body Parameters

  • monitor_name (string, required): The name of the monitor.

  • monitor_type (string, required): The type of monitor (e.g., condition-monitor, process-monitor, energy-monitor).

  • function_id (string, optional): The ID of the function associated with the monitor.

  • asset_id (string, optional): The ID of the asset associated with the monitor.

Sample Request

curl --location 'https://app.4pointx.com/_config/monitors' \
     --header 'Content-Type: application/json' \
     --header 'Authorization: Basic <token>' \
   --data '{
            "monitor_name":"new_mon_3",
            "monitor_type":"condition-monitor",
            "function_id": "45c98f40-75e3-49e7-b178-d25ec878db79"}'

Sample Response

Success

{
   "id": "464fa51b-e6c5-446a-acda-f45501922ac6"
}

Error

{
  "error": {
    "status": 401,
    "message": "Unauthorized access to module by general-user"
  }
}
{
  "error": {
    "status": 400,
    "message": "Invalid Content Type"
  }
}
{
  "error": {
    "status": 400,
    "message": "Insufficient Inputs"
  }
}
{
  "error": {
       "status": 400,
       "message": "Error creating new monitor"
  }
}
{
  "error": {
       "status": 400,
       "message": "Monitor create limit reached. Please verify your license status."
  }
}

Delete Monitor

DELETE /_config/monitors/<monitor_id>

Description This endpoint allows you to delete a specific monitor by providing its ID.

HTTP Method DELETE

Endpoint /_config/monitors/<monitor_id>

Request Header Authorization Basic <token>

Request Parameters

URL Parameters

  • monitor_id (string, required) The ID of the monitor to delete.

Sample Request

curl --location --request DELETE 'http://app.4pointx.com/_config/monitors/464fa51b-e6c5-446a-acda-f45501922ac6' \
     --header 'Authorization: Basic <token>' \
     --data ''

Sample Response

Success

"monitor deleted"

Error

{
  "error": {
    "status": 401,
    "message": "Unauthorized access to module by general-user"
  }
}
{
  "error": {
      "status": 400,
      "message": "Moniter is  registered to pipeline"
   }
}
{
  "error": {
       "status": 400,
       "message": "Invalid monitor id 62179fa51b-e6a-acda-f45501922ac6"
  }
}

Update Monitor

PUT /_config/monitors/<monitor_id>

Description This endpoint allows you to update the details of a specific monitor by providing its ID.

HTTP Method PUT

Endpoint /_config/monitors/<monitor_id>

Request Header Authorization Basic <token>

Request Parameters

Body Parameters

  • monitor_name (string, required): The name of the monitor.

  • monitor_type (string, required): The type of monitor (e.g., condition-monitor, process-monitor, energy-monitor).

  • tags (array, required): An array of tags associated with the monitor.

  • specs (object, required): Specifications or configuration data for the monitor.

  • attributes (object, required): Additional attributes for the monitor.

URL Parameters

  • monitor_id (string, required) The ID of the monitor to update.

Sample Request

curl --location --request PUT 'https://app.4pointx.com/_config/monitors/464fa51b-e6c5-446a-acda-f45501922ac6' \
     --header 'Content-Type: application/json' \
     --header 'Authorization: Basic <token>' \
     --data '{
               "attributes": {},
               "monitor_id": "72da5c8c-087f-484a-adb4-7d1657b0125e",
               "monitor_name": "dem_mon_test_0104",
               "monitor_type": "condition-monitor",
               "specs": {
                 "speed_type": "Fixed"
               },
               "tags": [
                 {
                   "tag_desc": "",
                   "tag_id": "displacement_x_72da5c8c-087f-484a-adb4-7d1657b0125e",
                   "tag_name": "displacement_x",
                   "tag_unit": "",
                   "thresholds": {
                     "caution": "25",
                     "operational": "10",
                     "warning": "60"
                   }
                 }
               ]
             }'

Sample Response

Success

" Monitor updated"

Error

{
  "error": {
    "status": 401,
    "message": "Unauthorized access to module by general-user"
  }
}
{
  "error": {
    "status": 400,
    "message": "Invalid Content Type"
  }
}
{
  "error": {
    "status": 400,
    "message":  "Insufficient Inputs"
  }
}
{
  "error": {
    "status": 400,
    "message":  "Invalid monitor"
  }
}

Fetch Monitors

GET /_config/monitors/<monitor_id>

Description This endpoint allows you to retrieve details about a specific monitor by providing its ID.

HTTP Method GET

Endpoint /_config/monitors/<monitor_id>

Request Header Authorization Basic <token>

Request Parameters

URL Parameters

  • monitor_id (string, required): The ID of the monitor to retrieve details for.

Sample Request

curl --location 'https://app.4pointx.com/_config/monitors/464fa51b-e6c5-446a-acda-f45501922ac6' \
      --header 'Authorization: Basic <token>'

Sample Response

Success

{
   "function_id": "45c98f40-75e3-49e7-b178-d25ec878db79",
   "monitor_name": "mod_new_mon_3",
   "monitor_id": "464fa51b-e6c5-446a-acda-f45501922ac6",
   "monitor_type": "condition-monitor",
   "created_at": 1712041979503,
   "gateway": {
       "pipeline_id": "5a8ea4bf-9bf0-49f8-843b-f0386927bdaa",
       "data_source": "Edge IoT Gateway",
       "data_source_subtype": "Modbus RTU",
       "slave_id": 2
   },
   "tags": [],
   "specs": {},
   "attributes": {}
}

Error

{
  "error": {
    "status": 401,
    "message": "Unauthorized access to module by general-user"
  }
}
{
  "error": {
       "status": 405,
        "message": "Method Not Allowed"
  }
}
{
  "error": {
       "status": 400,
       "message": "Invalid monitor id 62179fa51b-e6a-acda-f45501922ac6"
  }
}

Fetch List of Monitors

GET /_config/monitors/_list

Description Retrieve a list of assets based on various criteria such as function, asset category, and criticality.

HTTP Method GET

Endpoint /_config/monitors/_list

Request Header Authorization Basic <token>

Request Parameters

Query Parameters

  • asset_id (string, optional): Filter monitors by asset ID.

  • function_id (string, optional): Filter monitors by function ID.

  • is_registered (string, optional): Filter monitors by registration status (options: “yes” or “no”).

  • pipeline_id (string, optional): List monitors associated with a specific pipeline ID.

  • data_type (string, optional): Filter monitors by data_type (options: “all”,”energy”,”condition”,”process”).

Sample Request

curl --location 'https://app.4pointx.com/_config/monitors/_list?function_id=2136f450-1ab0-45ed-96fa-fec9c32da324' \
     --header 'Authorization: Basic <token>' \
     --data ''

Sample Response

Success

[
   {
      "monitor_id": "d6a4963d-2025-409d-8fa5-06e2de3ec572",
      "monitor_name": "test_monitor",
      "monitor_type": "condition-monitor",
      "created_at": null,
      "device_registered": false
   },
   {
      "monitor_id": "ec3d42d3-234f-4767-a579-23d9e73665c1",
      "monitor_name": "UX-Monitor",
      "monitor_type": "condition-monitor",
      "created_at": 1712041979503,
      "device_registered": false
   }
]

Error

{
  "error": {
    "status": 401,
    "message": "Unauthorized access to module by general-user"
  }
}
{
  "error": {
    "status": 400,
    "message":  "Insufficient Inputs"
  }
}
{
  "error": {
    "status": 400,
    "message":  "Invalid value for is_registered"
  }
}
{
  "error": {
    "status": 400,
    "message":  "Pipeline not found"
  }
}

Get Count of Monitors

GET /_config/monitors/_count

Description This endpoint allows you to count the number of monitors based on asset_id or function_id.

HTTP Method GET

Endpoint /_config/monitors/_count

Request Header Authorization Basic <token>

Request Parameters

Query Parameters

  • asset_id ( string, optional): Filter monitors by asset ID.

  • function_id (string, optional): Filter monitors by function ID.

Sample Request

curl --location 'https://app.4pointx.com/_config/monitors/_count?function_id=45c98f40-75e3-49e7-b178-d25ec878db79' \
     --header 'Authorization: Basic <token>' \
     --data ''

Sample Response

Success

7

Error

{
  "error": {
    "status": 401,
    "message": "Unauthorized access to module by general-user"
  }
}
{
  "error": {
    "status": 400,
    "message":  "Insufficient Inputs"
  }
}
{
  "error": {
    "status": 400,
    "message":   "Excess Inputs"
  }
}