Sections

Method: GET

Provides a detailed, time-stamped list of events for one or more devices on a given date, with optional filtering by shift.

Base URL

https://dlb.com.pl/api/v1/global_counter_tab.php

Query parameters

Key Type Description
user Required string Login
token string Authentication token (see Authentication)
date Required string Date in YYYY-MM-DD format.
Important: it is the date of start of 1st shift. 3rd shift is under the same date!
mac Required string MAC address of the device, or a comma-separated list of MAC addresses
shift string Filter results by shift: 1, 2, 3, or all (default: all)

Authentication

Providing token is also required, you can do it using one of the following methods:

  • Query parameter: token
  • Standard Bearer token in the header: Authorization: Bearer {token}
  • API key in the header: HTTP_X_API_KEY: {token}

Response

Response is a string to be decoded to a JSON object, where keys are MAC addresses of the requested devices and values are arrays of event objects. Each object represents one event recorded on the given date (filtered by shift if specified).

Key Type Description
name string Event name
duration number Event duration in seconds (rounded to 2 decimal places)
start string Event start timestamp (YYYY-MM-DD HH:MM:SS)
end string Event end timestamp (YYYY-MM-DD HH:MM:SS)
shift number Shift number (1, 2, or 3)

Example response:

{
    "00:00:95:9D:68:16": [
        {
            "name": "PRACA",
            "duration": 3600.00,
            "start": "2024-06-01 06:00:00",
            "end": "2024-06-01 07:00:00",
            "shift": 1
        },
        {
            "name": "POSTOJ",
            "duration": 900.00,
            "start": "2024-06-01 07:00:00",
            "end": "2024-06-01 07:15:00",
            "shift": 1
        }
    ]
}

Error Responses

HTTP Code Message Cause
400 400 Bad Request: missing parameters user, date, or mac query parameter is missing
400 400 Bad Request: invalid input data date value is not a valid YYYY-MM-DD date
400 400 Bad Request: invalid shift parameter shift value is not one of all, 1, 2, 3
400 400 Bad Request: missing parameter MAC mac value could not be parsed as a valid MAC address
403 403 Unauthorized access Authentication failed — invalid or missing token
405 405 Method Not Allowed Request method is not GET