Get clockguard records by service

This endpoint retrieves the consolidated clockguards of a service within a specific period not exceeding 31 days.

GET /api/v1/businesses/{businessId}/services/{serviceId}/clockguards?from={yyyy-MM-dd}&to={yyyy-MM-dd}

If the data included in the request is correct —both the businessId and the serviceId—, the response will contain the clockguards for the service 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 task identifier, product, geographical location, etc.

[
  {
    "employeeId": "2325",
    "productId": "0001-G",
    "locationId": "C14",
    "type": "WORK",
    "checkIn": "2021-08-12T04:00:00Z",
    "latIn": 3.676432,
    "lonIn": 3.676432,
    "deviceIn": "12345",
    "checkOut": "2021-08-12T06:00:00Z",
    "latOut": 3.676432,
    "lonOut": 3.676432,
    "deviceOut": "12345",
    "comment": "No error.",
    "orquestId": 3565687
  },
  {
    "employeeId": "2325",
    "productId": "0001-G",
    "locationId": "C14",
    "type": "WORK",
    "checkIn": "2021-08-13T04:00:00Z",
    "latIn": 3.676432,
    "lonIn": 3.676432,
    "deviceIn": "12345",
    "checkOut": "2021-08-13T08:00:00Z",
    "latOut": 3.676432,
    "lonOut": 3.676432,
    "deviceOut": "12345",
    "comment": "No error.",
    "orquestId": 3565688
  }
]

Records with only the basic information.

[
    {
        "employeeId": "1006350",
        "type": "WORK",
        "checkIn": "2024-04-26T13:00:00.000Z",
        "checkOut": "2024-04-26T15:00:00.000Z",
        "orquestId": 219986797
    },
    {
        "employeeId": "1006350",
        "type": "REST",
        "checkIn": "2024-04-26T12:00:00.000Z",
        "checkOut": "2024-04-26T13:00:00.000Z",
        "orquestId": 219987848
    },
    {
        "employeeId": "1006350",
        "type": "WORK",
        "checkIn": "2024-04-22T08:00:00.000Z",
        "checkOut": "2024-04-22T12:00:00.000Z",
        "orquestId": 219986798
    }
]

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": "REST",
        "checkIn": "2024-04-21T08:00:00.000Z",
        "orquestId": 219987849
    },
    {
        "employeeId": "1006350",
        "type": "REST",
        "checkIn": "2024-04-21T09:00:00.000Z",
        "orquestId": 219987850
    }
]

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 data from the date indicated in the from parameter to the date indicated in the to parameter, including both days.

The maximum allowed interval for the query is 31 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 service specified in the URL does not exist in the business, the request will return a 404 Not Found error indicating not exists.