Sections

Method: GET

Provides cumulative event durations (in seconds) per event name for one or more devices on a given date.

Base URL

https://dlb.com.pl/api/v1/global_counter_status_cml.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

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 JSON objects mapping event names to their total duration in seconds (rounded to 2 decimal places). Event names have emoji characters stripped.

Example response:

{
    "00:00:00:9D:68:16": {
        "PRACA": 18540.00,
        "POSTOJ": 7200.00,
        "ROZRUCH": 460.50
    },
    "00:00:00:9D:68:FF": {
        "POSTOJ": 86400.00,
    }
}

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: 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