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

id

Integer

Traffic-light ID.

name

String

Traffic-light name.

categoryId

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

id

Integer

Traffic-light ID.

name

String

Traffic-light name.

legend

Object []

Ordered legend entries.

legend[].name

String

Legend label.

legend[].colour

Integer

Colour as a Delphi TColor integer.

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

componentId

Integer

Component ID supplied in the request.

colour

Integer

Calculated colour as a Delphi TColor integer. Omitted when unavailable.

legendName

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 integer componentIds array.

  • 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.