Traffic Lights
Retrieve traffic-light definitions and calculate the traffic-light values for one or more assets.
All endpoints require authentication.
List traffic lights
GET /icweb.dll/traffic-lights
Returns the configured traffic lights, including the associated category ID when one is assigned.
Name |
Type |
Description |
|
Integer |
Traffic-light ID. |
|
String |
Traffic-light name. |
|
Integer |
Category ID. Omitted when no category is assigned. |
Example response:
[
{
"id": 12,
"name": "Asset Condition",
"categoryId": 3
}
]
Get a traffic light
GET /icweb.dll/traffic-lights/{trafficLightId}
Returns the traffic-light identity and its ordered legend. Colour values are
Delphi TColor integer values, consistent with the existing v1 response.
Name |
Type |
Description |
|
Integer |
Traffic-light ID. |
|
String |
Traffic-light name. |
|
Object [] |
Ordered legend entries. |
|
String |
Legend label. |
|
Integer |
Colour as a Delphi |
Example response:
{
"id": 12,
"name": "Asset Condition",
"legend": [
{
"name": "Poor",
"colour": 255
},
{
"name": "Good",
"colour": 32768
}
]
}
Calculate traffic-light values
POST /icweb.dll/traffic-lights/{trafficLightId}/values
The request body specifies the Component_ID values to evaluate. The
response contains one result per supplied component ID, in request order.
When a component has no calculated colour or display value, the corresponding
field is omitted from its result.
{
"componentIds": [101, 102]
}
Name |
Type |
Description |
|
Integer |
Component ID supplied in the request. |
|
Integer |
Calculated colour as a Delphi |
|
String |
Display value for the component. Omitted when unavailable. |
Example response:
[
{
"componentId": 101,
"colour": 255,
"legendName": "Poor"
},
{
"componentId": 102
}
]
Responses
200 OK— the request was processed.400 Bad Request— the request body is not an object containing an integercomponentIdsarray.401 Unauthorized— authentication is missing or invalid.404 Not Found— the traffic-light ID does not exist or the path is invalid.405 Method Not Allowed— the HTTP method is not supported for the endpoint.