Get clockguard records by product

This endpoint returns the consolidated clockguards made on a product within a specific period not exceeding 30 days.

GET /api/v1/business/{businessId}/product/{productId}/clockguards/from/{yyyy-MM-dd}/to/{yyyy-MM-dd}

If the data included in the request is correct —both the businessId and the productId—, the response will contain the list of clockguards for the product with all the defined information for them.

The data included in the response will depend on the information that has been previously associated with the record.

Below are some examples:

  • Example 1

  • Example 2

  • Example 3

Records with all possible information, including data on the task where the record was made.

[
    {
        "employeeId": "1006351",
        "location": {
            "color": "#5fe7d5",
            "description": "Daily truck unloading",
            "name": "UNLOADING",
            "shortName": "TD",
            "requiredLevel": 3,
            "priority": 5,
            "maxResources": 2,
            "type": "FIXED",
            "shouldAvoidOvercover": true,
            "system": false,
            "category": "OPERATIVE",
            "product": "0001-G",
            "id": "8"
        },
        "type": "WORK",
        "checkIn": "2024-05-10T07:00:00.000Z",
        "checkOut": "2024-05-10T09:00:00.000Z",
        "orquestId": 220030403
    },
    {
        "employeeId": "1006351",
        "location": {
            "color": "#5fe7d5",
            "description": "Daily truck unloading",
            "name": "UNLOADING",
            "shortName": "TD",
            "requiredLevel": 3,
            "priority": 5,
            "maxResources": 2,
            "type": "FIXED",
            "shouldAvoidOvercover": true,
            "system": false,
            "category": "OPERATIVE",
            "product": "0001-G",
            "id": "8"
        },
        "type": "WORK",
        "checkIn": "2024-05-13T07:00:00.000Z",
        "checkOut": "2024-05-13T09:00:00.000Z",
        "orquestId": 220030404
    }
]

Records with only the basic information.

[
    {
        "employeeId": "1006350",
        "type": "WORK",
        "checkIn": "2024-05-10T07:00:00.000Z",
        "checkOut": "2024-05-10T12:00:00.000Z",
        "orquestId": 220030406
    },
    {
        "employeeId": "1006350",
        "type": "REST",
        "checkIn": "2024-05-10T10:00:00.000Z",
        "checkOut": "2024-05-10T10:30:00.000Z",
        "orquestId": 220030407
    },
    {
        "employeeId": "1006350",
        "type": "WORK",
        "checkIn": "2024-05-13T07:00:00.000Z",
        "checkOut": "2024-05-13T12:00:00.000Z",
        "orquestId": 220030408
    }
]

If there are errors in the record, for example, the same type of clockguard (IN), the API returns the data as it was registered:

[
    {
        "employeeId": "1006350",
        "type": "WORK",
        "checkIn": "2024-05-14T07:00:00.000Z",
        "orquestId": 220030409
    },
    {
        "employeeId": "1006350",
        "type": "WORK",
        "checkIn": "2024-05-14T12:00:00.000Z",
        "orquestId": 220030410
    }
]

As shown in the examples, the request returns the data as it was registered, so the level of detail in the response will depend on the data previously sent: for example, if the registration includes the clockguard device identifier (device), the request will also return that information linked to the record.

Considerations

This request returns only consolidated clockguards.

The API returns the data in the order of registration, in UTC and in yyyy-MM-ddTHH:mm:ss.SSSZ format.

The response will contain the data up to the date specified in the to parameter, excluding the data of that day. For example, if clockguards are queried up to 2024-05-14, the data for the 14th will not appear in the response.

The maximum allowed interval for the query is 30 days. If the period indicated in the URL is longer, the request will return a 406 Not Acceptable error.

If there is no data for that period, the request will return an empty array [].

If the product specified in the URL does not exist in the business, the request will return a 404 Not Found error indicating not exists.