CM Events¶
Update Event¶
- PUT /_cm/events/<event_id>¶
Description Update the event details.
Http Method PUT
ENDPOINT
/_cm/events/<event_id>
Request Header
Authorization
Basic <token>Request Parameters
URL Parameters
event_id
(string, required): The ID of the Event.
Body Parameters
event_label
(string, required): Label/Name for the Event.event_tag
(list of strings, required): Tags for easy filtering and finding similar events.event_note
(string, required): Note regarding the Event.event_cause
(string, required): Cause of the Event.event_assignee
(string, required): Assignee of the Event.event_action
(string, required): Action taken for the Event.
Sample Request
curl --location 'https://app.4pointx.com/_cm/events/11666bd5-b036-427e-b209-ccf317f5b42a' \ -H 'Content-Type: application/json' \ -H 'Authorization: Basic <token>' \ -d '{ "event_label": "Bearing Failure", "event_tag": ["Bearing Failure"], "event_note": "Raise a request for part: bearing", "event_cause": "Bearing Issue", "event_assignee": "user1@email.com", "event_action": "Bearing replacement" }'
Sample Response
Success
"Updated"
Error
{ "error": { "status": 401, "message": "Unauthorized access to module by general-user" } }
{ "error": { "status": 500, "message": "Error occurred during update" } }
{ "error": { "status": 400, "message": "Insufficient inputs" } }
Fetch Event¶
- GET /_cm/events/<event_id>¶
Description Fetch details of an Event
Http Method GET
ENDPOINT
/_cm/events/<event_id>
Request Header
Authorization
Basic <token>Request Parameters
URL Parameters
event_id
(string, required): The ID of the Event.
Sample Request
curl --location 'https://app.4pointx.com/_cm/events/11666bd5-b036-427e-b209-ccf317f5b42a' \ --header 'Authorization: Basic <token>'
Sample Response
Success
{ "event_id": "11666bd5-b036-427e-b209-ccf317f5b42a", "asset_id": "6a866d13-aa36-4e14-a487-cb6b0c312691", "event_label": "Bearing Failure", "event_type": "threshold-breached", "event_tag": [ "Bearing failure" ], "event_severity": 1, "event_start": 1711601935, "event_end": null, "event_status": "Under Investigation", "event_log": [ "28 Mar 2024, 10:28:55 AM - velocity x breach detected with severity: High", "28 Mar 2024, 10:28:55 AM - velocity y breach detected with severity: High" ], "event_note": "Raise a request for part: bearing", "event_cause": "Bearing balls Problem", "event_assignee": "user1@email.com", "event_action": "Bearing replacement", "tags_breached": [ "velocity_x", "velocity_y" ], "asset_faults": [], "asset_status": "warning", "flag_count": 2, "event_update_time": 1712051932, "asset_name": "CM_TEST_1" }
Error
{ "error": { "status": 401, "message": "Unauthorized access to module by general-user" } }
{ "error": { "status": 400, "message": "Insufficient inputs" } }
Fetch Event List¶
- GET /_cm/events/_list¶
Description Fetch a list of events based on the provided asset id within a specified time period.
Http Method GET
ENDPOINT
/_cm/events/_list
Request Header
Authorization
Basic <token>Request Parameters
URL Parameters
assets_id
(string, required): The ID of the associated asset.from
(string, required): The start time of the time range.to
(string, required): The end time of the time range
Sample Request
curl --location 'https://app.4pointx.com/_cm/events/_list?asset_id=6a866d13-aa36-4e14-a487-cb6b0c312691&from=1711500000&to=1712052192' \ --header 'Authorization: Basic <token>'
Sample Response
Success
[ { "event_id": "11666bd5-b036-427e-b209-ccf317f5b42a", "asset_id": "6a866d13-aa36-4e14-a487-cb6b0c312691", "event_label": "Bearing Failure", "event_type": "threshold-breached", "event_tag": [ "Bearing failure" ], "event_severity": 1, "event_start": 1711601935, "event_end": null, "event_status": "Under Investigation", "event_log": [ "28 Mar 2024, 10:28:55 AM - velocity x breach detected with severity: High", "28 Mar 2024, 10:28:55 AM - velocity y breach detected with severity: High" ], "event_note": "Raise a request for part: bearing", "event_cause": "Bearing balls Problem", "event_assignee": "user1@email.com", "event_action": "Bearing replacement", "tags_breached": [ "velocity_x", "velocity_y" ], "asset_faults": [], "asset_status": "warning", "event_update_time": 1712051932, }, { "event_id": "fd93cb35-b1a1-45cc-8d79-cabf417c15a1", "asset_id": "6a866d13-aa36-4e14-a487-cb6b0c312691", "event_label": "fd93cb35-b1a1-45cc-8d79-cabf417c15a1", "event_type": [ "threshold-breached" ], "event_tag": [], "event_severity": 1, "event_start": 1711601935, "event_end": 1712134096, "event_status": "Ignored", "event_log": [ "28 Mar 2024, 10:28:55 AM - velocity x breach detected with severity: High" ], "event_note": "", "event_cause": null, "event_assignee": null, "event_action": null, "tags_breached": [ "velocity_x" ], "asset_faults": [], "asset_status": "warning", "event_update_time": 1712051932, } ]
Error
{ "error": { "status": 401, "message": "Unauthorized access to module by general-user" } }
{ "error": { "status": 400, "message": "Insufficient inputs" } }
{ "error": { "status": 404, "message": "Asset not found!" } }
{ "error": { "status": 400, "message": "Invalid date format" } }
{ "error": { "status": 500, "message": "Internal Server Error" } }