API

NoiseGuard API (NG API) is organized around REST. NG API has predefined URLs that are easy to use and return JSON encoded responses.

NG API is locked by default, which is indicated by the “lock” icon on the “Settings” page. To unlock it, please contact IMS. Once the NG API is unlocked, you can toggle it on or off from the “Settings” page.

Enable or disable the NG API

You can enable and disable the NG API from the “Settings” page by toggling the API switch. When enabled, the “API Token” field will appear.

If the “API Token” field is empty, click on the “Generate API token” button. Your new API token will be generated.
Don’t forget to save your settings by clicking the “Save” button.

Verify NG API

You can verify that the NG API is enabled by going to:
http://YOUR-WEBSITE-GOES-HERE/api/v1/API-TOKEN-GOES-HERE

(example: http://domain.com/api/v1/B9LMXHTT7ZB2UIRZ9GTMY2)

Or you can simply click on the generated “Public API link”, which is located above the “API Token” field. You should see the following text: 200 | API TOKEN ACCEPTED.

In case you experience any problems, please contact IMS.

List of commands

GET /api/v1/API-TOKEN
http://domain.com/api/v1/B9LMXHTT7ZB2UIRZ9GTMY2
This is used to verify that the NG API is working.

GET /api/v1/API-TOKEN/jwt
http://domain.com/api/v1/B9LMXHTT7ZB2UIRZ9GTMY2/jwt
To access real-time data from the terminals (using Websockets), you will need to authenticate using “Live API token”. Generated token is valid for 24 hours, after that period, you need to obtain a new one.

Returns JSON object “live_api_token” (string).

{
"live_api_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiIsImp0aSI6IjRmMWcyM2ExMmFhIn0.eyJpc3MiOiJodHRwOlwvXC9sb2NhbGhvc3QiLCJqdGkiOiI0ZjFnMjNhMTJhYSIsImlhdCI6MTYwNzk1NDAyNSwiZXhwIjoxNjA4MDQwNDI1LCJvcmdpZCI6MSwidHlwZSI6ImFwaUNsaWVudCIsImlkIjoyfQ.X_3v1HIOSOwAou8PvzmX3ZHrn2Rps-n4S4Q0lOv-He8"
}

GET /api/v1/API-TOKEN/terminals
http://domain.com/api/v1/B9LMXHTT7ZB2UIRZ9GTMY2/terminals
Returns an array of all terminal objects with the following properties:

  • “id” (integer)
  • “terminal_token” (string)
  • “name” (string)
  • “serial” (string)
  • “description” (string | null)
  • “latitude” (double)
  • “longitude” (double)
  • “slm_type” (string | null)
  • “slm_serial” (string | null)
  • “transducer_type” (string | null)
  • “transducer_serial” (string | null)
  • “last_data” (string | null)

[
{
"id": 1,
"name": "Terminal 1",
"serial": "NG1",
"description": "random text here",
"latitude": 45.5362,
"longitude": 13.7127,
"slm_type": "2250",
"slm_serial": "123456",
"transducer_type": "4952_90",
"transducer_serial": "123456",
"last_data": "2020-12-31 23:59:00"
},
{
"id": 2,
"name": "Terminal 2",
"serial": "NG2",
"description": null,
"latitude": 45.5712,
"longitude": 13.7713,
"slm_type": "2250",
"slm_serial": "123456",
"transducer_type": "4952_90",
"transducer_serial": "123456",
"last_data": "2020-12-31 23:59:00"
}
]

GET /api/v1/API-TOKEN/terminals/TERMINAL-ID
http://domain.com/api/v1/B9LMXHTT7ZB2UIRZ9GTMY2/terminals/1
Returns a specific terminal object identified by TERMINAL-ID with the following properties:

  • “id” (integer)
  • “terminal_token” (string)
  • “name” (string)
  • “serial” (string)
  • “description” (string | null)
  • “latitude” (double)
  • “longitude” (double)
  • “slm_type” (string | null)
  • “slm_serial” (string | null)
  • “transducer_type” (string | null)
  • “transducer_serial” (string | null)
  • “last_data” (string | null)

{
"id": 1,
"name": "Terminal 1",
"serial": "NG1",
"description": null,
"latitude": 45.5362,
"longitude": 13.7127,
"slm_type": "2250",
"slm_serial": "3028774",
"transducer_type": "4952_90",
"transducer_serial": "2653057",
"last_data": "2020-09-30 10:27:00"
}

GET /api/v1/API-TOKEN/terminals/TERMINAL-ID/data/get
http://domain.com/api/v1/B9LMXHTT7ZB2UIRZ9GTMY2/terminals/1/data/get
Returns the measurement’s data object for the latest minute for the specific terminal with the following properties:

  • “id” (integer)
  • “timestamp” (string)
  • “LAeq” (double | null)
  • “LCpeak” (double | null)
  • “LA1” (double | null)
  • “LA5” (double | null)
  • “LA10” (double | null)
  • “LA50” (double | null)
  • “LA90” (double | null)
  • “LA95” (double | null)
  • “LA99” (double | null)
  • “LAF_max” (double | null)
  • “LAF_min” (double | null)
  • “wind_speed” (double | null)
  • “wind_direction” (double | null)
  • “rain” (double | null)
  • “temperature” (double | null)
  • “pressure” (double | null)
  • “humidity” (double | null)
  • “latitude” (double | null)
  • “longitude” (double | null)

{
"id": 2036163,
"timestamp": "2020-12-31 23:59:00",
"LAeq": 48.32,
"LCpeak": 79.11,
"LA1": 54.66,
"LA5": 48.45,
"LA10": 47.77,
"LA50": 46.49,
"LA90": 45.18,
"LA95": 45.39,
"LA99": 45.63,
"LAF_max": 66.88,
"LAF_min": 44.55,
"wind_speed": 0,
"wind_direction": 0,
"rain": 1.3,
"temperature": 21.5,
"pressure": 995,
"humidity": 55,
"latitude": null,
"longitude": null
}

GET /api/v1/API-TOKEN/terminals/TERMINAL-ID/data/get/DATE
http://domain.com/api/v1/B9LMXHTT7ZB2UIRZ9GTMY2/terminals/1/data/get/2020-12-31
Returns the measurement’s data object for the latest minute of a specific terminal and date with the following properties:

  • “id” (integer)
  • “timestamp” (string)
  • “LAeq” (double | null)
  • “LCpeak” (double | null)
  • “LA1” (double | null)
  • “LA5” (double | null)
  • “LA10” (double | null)
  • “LA50” (double | null)
  • “LA90” (double | null)
  • “LA95” (double | null)
  • “LA99” (double | null)
  • “LAF_max” (double | null)
  • “LAF_min” (double | null)
  • “wind_speed” (double | null)
  • “wind_direction” (double | null)
  • “rain” (double | null)
  • “temperature” (double | null)
  • “pressure” (double | null)
  • “humidity” (double | null)
  • “latitude” (double | null)
  • “longitude” (double | null)

{
"id": 2036163,
"timestamp": "2020-12-31 23:59:00",
"LAeq": 48.32,
"LCpeak": 79.11,
"LA1": 54.66,
"LA5": 48.45,
"LA10": 47.77,
"LA50": 46.49,
"LA90": 45.18,
"LA95": 45.39,
"LA99": 45.63,
"LAF_max": 66.88,
"LAF_min": 44.55,
"wind_speed": 0,
"wind_direction": 0,
"rain": 1.3,
"temperature": 21.5,
"pressure": 995,
"humidity": 55,
"latitude": null,
"longitude": null
}

GET /api/v1/API-TOKEN/terminals/TERMINAL-ID/data/get/DATE/TIME
http://domain.com/api/v1/B9LMXHTT7ZB2UIRZ9GTMY2/terminals/1/data/get/2020-12-31/23:59
Returns the measurement’s data object for a specific terminal, date and time with the following properties:

  • “id” (integer)
  • “timestamp” (string)
  • “LAeq” (double | null)
  • “LCpeak” (double | null)
  • “LA1” (double | null)
  • “LA5” (double | null)
  • “LA10” (double | null)
  • “LA50” (double | null)
  • “LA90” (double | null)
  • “LA95” (double | null)
  • “LA99” (double | null)
  • “LAF_max” (double | null)
  • “LAF_min” (double | null)
  • “wind_speed” (double | null)
  • “wind_direction” (double | null)
  • “rain” (double | null)
  • “temperature” (double | null)
  • “pressure” (double | null)
  • “humidity” (double | null)
  • “latitude” (double | null)
  • “longitude” (double | null)

{
"id": 2036163,
"timestamp": "2020-12-31 23:59:00",
"LAeq": 48.32,
"LCpeak": 79.11,
"LA1": 54.66,
"LA5": 48.45,
"LA10": 47.77,
"LA50": 46.49,
"LA90": 45.18,
"LA95": 45.39,
"LA99": 45.63,
"LAF_max": 66.88,
"LAF_min": 44.55,
"wind_speed": 0,
"wind_direction": 0,
"rain": 1.3,
"temperature": 21.5,
"pressure": 995,
"humidity": 55,
"latitude": null,
"longitude": null
}

GET /api/v1/API-TOKEN/terminals/TERMINAL-ID/data/from/DATE-START
http://domain.com/api/v1/B9LMXHTT7ZB2UIRZ9GTMY2/terminals/1/data/from/2020-12-25
Returns an array of all the measurements’ data objects for a specific terminal between DATE-START and today’s dates with the following properties:

  • “id” (integer)
  • “timestamp” (string)
  • “LAeq” (double | null)
  • “LCpeak” (double | null)
  • “LA1” (double | null)
  • “LA5” (double | null)
  • “LA10” (double | null)
  • “LA50” (double | null)
  • “LA90” (double | null)
  • “LA95” (double | null)
  • “LA99” (double | null)
  • “LAF_max” (double | null)
  • “LAF_min” (double | null)
  • “wind_speed” (double | null)
  • “wind_direction” (double | null)
  • “rain” (double | null)
  • “temperature” (double | null)
  • “pressure” (double | null)
  • “humidity” (double | null)
  • “latitude” (double | null)
  • “longitude” (double | null)

[
{
"id": 2036163,
"timestamp": "2020-12-25 09:55:00",
"LAeq": 48.32,
"LCpeak": 79.11,
"LA1": 54.66,
"LA5": 48.45,
"LA10": 47.77,
"LA50": 46.49,
"LA90": 45.18,
"LA95": 45.39,
"LA99": 45.63,
"LAF_max": 66.88,
"LAF_min": 44.55,
"wind_speed": 0,
"wind_direction": 0,
"rain": 1.3,
"temperature": 21.5,
"pressure": 995,
"humidity": 55,
"latitude": null,
"longitude": null
},
...
{
"id": 2045720,
"timestamp": "2020-12-31 23:59:00",
"LAeq": 48.32,
"LCpeak": 79.11,
"LA1": 54.66,
"LA5": 48.45,
"LA10": 47.77,
"LA50": 46.49,
"LA90": 45.18,
"LA95": 45.39,
"LA99": 45.63,
"LAF_max": 66.88,
"LAF_min": 44.55,
"wind_speed": 0,
"wind_direction": 0,
"rain": 1.3,
"temperature": 21.5,
"pressure": 995,
"humidity": 55,
"latitude": null,
"longitude": null
}
]

GET /api/v1/API-TOKEN/terminals/TERMINAL-ID/data/from/DATE-START/DATE-END
http://domain.com/api/v1/B9LMXHTT7ZB2UIRZ9GTMY2/terminals/1/data/from/2020-12-25/2020-12-31
Returns an array of all the measurements’ data objects for a specific terminal between DATE-START and DATE-END with the following properties:

  • “id” (integer)
  • “timestamp” (string)
  • “LAeq” (double | null)
  • “LCpeak” (double | null)
  • “LA1” (double | null)
  • “LA5” (double | null)
  • “LA10” (double | null)
  • “LA50” (double | null)
  • “LA90” (double | null)
  • “LA95” (double | null)
  • “LA99” (double | null)
  • “LAF_max” (double | null)
  • “LAF_min” (double | null)
  • “wind_speed” (double | null)
  • “wind_direction” (double | null)
  • “rain” (double | null)
  • “temperature” (double | null)
  • “pressure” (double | null)
  • “humidity” (double | null)
  • “latitude” (double | null)
  • “longitude” (double | null)

[
{
"id": 2036163,
"timestamp": "2020-12-25 09:55:00",
"LAeq": 48.32,
"LCpeak": 79.11,
"LA1": 54.66,
"LA5": 48.45,
"LA10": 47.77,
"LA50": 46.49,
"LA90": 45.18,
"LA95": 45.39,
"LA99": 45.63,
"LAF_max": 66.88,
"LAF_min": 44.55,
"wind_speed": 0,
"wind_direction": 0,
"rain": 1.3,
"temperature": 21.5,
"pressure": 995,
"humidity": 55,
"latitude": null,
"longitude": null
},
...
{
"id": 2045720,
"timestamp": "2020-12-31 23:59:00",
"LAeq": 48.32,
"LCpeak": 79.11,
"LA1": 54.66,
"LA5": 48.45,
"LA10": 47.77,
"LA50": 46.49,
"LA90": 45.18,
"LA95": 45.39,
"LA99": 45.63,
"LAF_max": 66.88,
"LAF_min": 44.55,
"wind_speed": 0,
"wind_direction": 0,
"rain": 1.3,
"temperature": 21.5,
"pressure": 995,
"humidity": 55,
"latitude": null,
"longitude": null
}
]

GET /api/v1/API-TOKEN/terminals/TERMINAL-ID/data/average
http://domain.com/api/v1/B9LMXHTT7ZB2UIRZ9GTMY2/terminals/1/data/average
Returns the object “average” of all the measured data for a specific terminal with the following properties:

  • “timestamp_start” (string)
  • “timestamp_end” (string)
  • “LAeq” (double | null)
  • “LCpeak” (double | null)
  • “LA1” (double | null)
  • “LA5” (double | null)
  • “LA10” (double | null)
  • “LA50” (double | null)
  • “LA90” (double | null)
  • “LA95” (double | null)
  • “LA99” (double | null)
  • “LAF_max” (double | null)
  • “LAF_min” (double | null)
  • “wind_speed” (double | null)
  • “wind_direction” (double | null)
  • “rain” (double | null)
  • “temperature” (double | null)
  • “pressure” (double | null)
  • “humidity” (double | null)
  • “number_of_logs” (int)

{
"timestamp_start": "2020-01-01 00:00",
"timestamp_end": "2020-12-31 23:59",
"LAeq": 53.68,
"LCpeak": 93.39,
"LAF_max": 109,
"LAF_min": 0,
"LA1": 53.86,
"LA5": 51.74,
"LA10": 50.77,
"LA50": 48.36,
"LA90": 46.84,
"LA95": 30.11,
"LA99": 46.05,
"humidity": 48.2,
"pressure": 1002,
"rain": 0.4,
"temperature": 19.4,
"wind_speed": 2.2,
"wind_direction": 70,
"number_of_logs": 525600
}

GET /api/v1/API-TOKEN/terminals/TERMINAL-ID/data/average/DATE-START
http://domain.com/api/v1/B9LMXHTT7ZB2UIRZ9GTMY2/terminals/1/data/average/2020-12-25
Returns the object “average” of all the measured data for a specific terminal between DATE-START and today’s date with the following properties:

  • “timestamp_start” (string)
  • “timestamp_end” (string)
  • “LAeq” (double | null)
  • “LCpeak” (double | null)
  • “LA1” (double | null)
  • “LA5” (double | null)
  • “LA10” (double | null)
  • “LA50” (double | null)
  • “LA90” (double | null)
  • “LA95” (double | null)
  • “LA99” (double | null)
  • “LAF_max” (double | null)
  • “LAF_min” (double | null)
  • “wind_speed” (double | null)
  • “wind_direction” (double | null)
  • “rain” (double | null)
  • “temperature” (double | null)
  • “pressure” (double | null)
  • “humidity” (double | null)
  • “number_of_logs” (int)

{
"timestamp_start": "2020-01-01 00:00",
"timestamp_end": "2020-12-31 23:59",
"LAeq": 53.68,
"LCpeak": 93.39,
"LAF_max": 109,
"LAF_min": 0,
"LA1": 53.86,
"LA5": 51.74,
"LA10": 50.77,
"LA50": 48.36,
"LA90": 46.84,
"LA95": 30.11,
"LA99": 46.05,
"humidity": 48.2,
"pressure": 1002,
"rain": 0.4,
"temperature": 19.4,
"wind_speed": 2.2,
"wind_direction": 70,
"number_of_logs": 525600
}

GET /api/v1/API-TOKEN/terminals/TERMINAL-ID/data/average/DATE-START/DATE-END
http://domain.com/api/v1/B9LMXHTT7ZB2UIRZ9GTMY2/terminals/1/data/average/2020-12-25/2020-12-31
Returns the object “average” of all the measured data for a specific terminal between DATE-START and DATE-END with the following properties:

  • “timestamp_start” (string)
  • “timestamp_end” (string)
  • “LAeq” (double | null)
  • “LCpeak” (double | null)
  • “LA1” (double | null)
  • “LA5” (double | null)
  • “LA10” (double | null)
  • “LA50” (double | null)
  • “LA90” (double | null)
  • “LA95” (double | null)
  • “LA99” (double | null)
  • “LAF_max” (double | null)
  • “LAF_min” (double | null)
  • “wind_speed” (double | null)
  • “wind_direction” (double | null)
  • “rain” (double | null)
  • “temperature” (double | null)
  • “pressure” (double | null)
  • “humidity” (double | null)
  • “number_of_logs” (int)

{
"timestamp_start": "2020-12-25 00:00",
"timestamp_end": "2020-12-31 23:59",
"LAeq": 53.68,
"LCpeak": 93.39,
"LAF_max": 109,
"LAF_min": 0,
"LA1": 53.86,
"LA5": 51.74,
"LA10": 50.77,
"LA50": 48.36,
"LA90": 46.84,
"LA95": 30.11,
"LA99": 46.05,
"humidity": 48.2,
"pressure": 1002,
"rain": 0.4,
"temperature": 19.4,
"wind_speed": 2.2,
"wind_direction": 70,
"number_of_logs": 8640
}

GET /api/v1/API-TOKEN/terminals/TERMINAL-ID/cpb/get
http://domain.com/api/v1/B9LMXHTT7ZB2UIRZ9GTMY2/terminals/1/cpb/get
Returns the latest measurement’s CPB data object with the following properties:

  • “id” (integer)
  • “timestamp” (string)
  • “weight” (string)
  • “12.5” (double)
  • “16” (double)
  • “20” (double)
  • “25” (double)
  • “31.5” (double)
  • “40” (double)
  • “50” (double)
  • “63” (double)
  • “80” (double)
  • “100” (double)
  • “125” (double)
  • “160” (double)
  • “200” (double)
  • “250” (double)
  • “315” (double)
  • “400” (double)
  • “500” (double)
  • “630” (double)
  • “800” (double)
  • “1k” (double)
  • “1.25k” (double)
  • “1.6k” (double)
  • “2k” (double)
  • “2.5k” (double)
  • “3.15k” (double)
  • “4k” (double)
  • “5k” (double)
  • “6.3k” (double)
  • “8k” (double)
  • “10k” (double)
  • “12.5k” (double)
  • “16k” (double)
  • “20k” (double)

{
"id": 2036152,
"timestamp": "2020-12-31 23:59:00",
"weight": "Z",
"12.5": 57.77,
"16": 62.31,
"20": 59.1,
"25": 61.17,
"31.5": 60,
"40": 61.27,
"50": 61.17,
"63": 52.68,
"80": 45.76,
"100": 42.33,
"125": 41.07,
"160": 41.96,
"200": 42,
"250": 39.41,
"315": 38.88,
"400": 38.28,
"500": 38.59,
"630": 39.77,
"800": 41.94,
"1k": 42.96,
"1.25k": 40.37,
"1.6k": 38.51,
"2k": 35.85,
"2.5k": 31.85,
"3.15k": 27.92,
"4k": 23.4,
"5k": 18.63,
"6.3k": 13.42,
"8k": 11.4,
"10k": 11.52,
"12.5k": 14.36,
"16k": 16.7,
"20k": 16.88
}

GET /api/v1/API-TOKEN/terminals/TERMINAL-ID/cpb/get/DATE
http://domain.com/api/v1/B9LMXHTT7ZB2UIRZ9GTMY2/terminals/1/cpb/get/2020-12-31
Returns the measurement’s CPB data object for a specific terminal and date with the following properties:

  • “id” (integer)
  • “timestamp” (string)
  • “weight” (string)
  • “12.5” (double)
  • “16” (double)
  • “20” (double)
  • “25” (double)
  • “31.5” (double)
  • “40” (double)
  • “50” (double)
  • “63” (double)
  • “80” (double)
  • “100” (double)
  • “125” (double)
  • “160” (double)
  • “200” (double)
  • “250” (double)
  • “315” (double)
  • “400” (double)
  • “500” (double)
  • “630” (double)
  • “800” (double)
  • “1k” (double)
  • “1.25k” (double)
  • “1.6k” (double)
  • “2k” (double)
  • “2.5k” (double)
  • “3.15k” (double)
  • “4k” (double)
  • “5k” (double)
  • “6.3k” (double)
  • “8k” (double)
  • “10k” (double)
  • “12.5k” (double)
  • “16k” (double)
  • “20k” (double)

{
"id": 2036150,
"timestamp": "2020-12-31 23:59:00",
"weight": "Z",
"12.5": 47.16,
"16": 48.59,
"20": 45.96,
"25": 49.1,
"31.5": 51.9,
"40": 48.88,
"50": 50.58,
"63": 51.82,
"80": 43.79,
"100": 39.01,
"125": 38.32,
"160": 37.48,
"200": 36.56,
"250": 36.03,
"315": 34.46,
"400": 33.05,
"500": 33.63,
"630": 32.98,
"800": 34.33,
"1k": 32.95,
"1.25k": 30.23,
"1.6k": 27.91,
"2k": 25.61,
"2.5k": 23.93,
"3.15k": 26.77,
"4k": 31.37,
"5k": 26.36,
"6.3k": 21.56,
"8k": 17.64,
"10k": 13.71,
"12.5k": 16,
"16k": 17.18,
"20k": 17.09
}

GET /api/v1/API-TOKEN/terminals/TERMINAL-ID/cpb/get/DATE/TIME
http://domain.com/api/v1/B9LMXHTT7ZB2UIRZ9GTMY2/terminals/1/cpb/get/2020-12-31/23:59
Returns the measurement’s CPB data object for a specific terminal, date and time with the following properties:

  • “id” (integer)
  • “timestamp” (string)
  • “weight” (string)
  • “12.5” (double)
  • “16” (double)
  • “20” (double)
  • “25” (double)
  • “31.5” (double)
  • “40” (double)
  • “50” (double)
  • “63” (double)
  • “80” (double)
  • “100” (double)
  • “125” (double)
  • “160” (double)
  • “200” (double)
  • “250” (double)
  • “315” (double)
  • “400” (double)
  • “500” (double)
  • “630” (double)
  • “800” (double)
  • “1k” (double)
  • “1.25k” (double)
  • “1.6k” (double)
  • “2k” (double)
  • “2.5k” (double)
  • “3.15k” (double)
  • “4k” (double)
  • “5k” (double)
  • “6.3k” (double)
  • “8k” (double)
  • “10k” (double)
  • “12.5k” (double)
  • “16k” (double)
  • “20k” (double)

{
"id": 2036150,
"timestamp": "2020-12-31 23:59:00",
"weight": "Z",
"12.5": 47.16,
"16": 48.59,
"20": 45.96,
"25": 49.1,
"31.5": 51.9,
"40": 48.88,
"50": 50.58,
"63": 51.82,
"80": 43.79,
"100": 39.01,
"125": 38.32,
"160": 37.48,
"200": 36.56,
"250": 36.03,
"315": 34.46,
"400": 33.05,
"500": 33.63,
"630": 32.98,
"800": 34.33,
"1k": 32.95,
"1.25k": 30.23,
"1.6k": 27.91,
"2k": 25.61,
"2.5k": 23.93,
"3.15k": 26.77,
"4k": 31.37,
"5k": 26.36,
"6.3k": 21.56,
"8k": 17.64,
"10k": 13.71,
"12.5k": 16,
"16k": 17.18,
"20k": 17.09
}

GET /api/v1/API-TOKEN/terminals/TERMINAL-ID/cpb/from/DATE-START
http://domain.com/api/v1/B9LMXHTT7ZB2UIRZ9GTMY2/terminals/1/cpb/from/2020-12-25
Returns an array of all measurements’ CPB data objects for a specific terminal between DATE-START and today’s dates with the following properties:

  • “id” (integer)
  • “timestamp” (string)
  • “weight” (string)
  • “12.5” (double)
  • “16” (double)
  • “20” (double)
  • “25” (double)
  • “31.5” (double)
  • “40” (double)
  • “50” (double)
  • “63” (double)
  • “80” (double)
  • “100” (double)
  • “125” (double)
  • “160” (double)
  • “200” (double)
  • “250” (double)
  • “315” (double)
  • “400” (double)
  • “500” (double)
  • “630” (double)
  • “800” (double)
  • “1k” (double)
  • “1.25k” (double)
  • “1.6k” (double)
  • “2k” (double)
  • “2.5k” (double)
  • “3.15k” (double)
  • “4k” (double)
  • “5k” (double)
  • “6.3k” (double)
  • “8k” (double)
  • “10k” (double)
  • “12.5k” (double)
  • “16k” (double)
  • “20k” (double)

[
{
"id": 2036152,
"timestamp": "2020-12-25 09:55:00",
"weight": "Z",
"12.5": 57.77,
"16": 62.31,
"20": 59.1,
"25": 61.17,
"31.5": 60,
"40": 61.27,
"50": 61.17,
"63": 52.68,
"80": 45.76,
"100": 42.33,
"125": 41.07,
"160": 41.96,
"200": 42,
"250": 39.41,
"315": 38.88,
"400": 38.28,
"500": 38.59,
"630": 39.77,
"800": 41.94,
"1k": 42.96,
"1.25k": 40.37,
"1.6k": 38.51,
"2k": 35.85,
"2.5k": 31.85,
"3.15k": 27.92,
"4k": 23.4,
"5k": 18.63,
"6.3k": 13.42,
"8k": 11.4,
"10k": 11.52,
"12.5k": 14.36,
"16k": 16.7,
"20k": 16.88
},
...
{
"id": 2036150,
"timestamp": "2020-12-31 23:59:00",
"weight": "Z",
"12.5": 47.16,
"16": 48.59,
"20": 45.96,
"25": 49.1,
"31.5": 51.9,
"40": 48.88,
"50": 50.58,
"63": 51.82,
"80": 43.79,
"100": 39.01,
"125": 38.32,
"160": 37.48,
"200": 36.56,
"250": 36.03,
"315": 34.46,
"400": 33.05,
"500": 33.63,
"630": 32.98,
"800": 34.33,
"1k": 32.95,
"1.25k": 30.23,
"1.6k": 27.91,
"2k": 25.61,
"2.5k": 23.93,
"3.15k": 26.77,
"4k": 31.37,
"5k": 26.36,
"6.3k": 21.56,
"8k": 17.64,
"10k": 13.71,
"12.5k": 16,
"16k": 17.18,
"20k": 17.09
}
]

GET /api/v1/API-TOKEN/terminals/TERMINAL-ID/cpb/from/DATE-START/DATE-END
http://domain.com/api/v1/B9LMXHTT7ZB2UIRZ9GTMY2/terminals/1/cpb/from/2020-12-25/2020
Returns an array of all measurements’ CPB data objects for a specific terminal between DATE-START and DATE-END with the following properties:

  • “id” (integer)
  • “timestamp” (string)
  • “weight” (string)
  • “12.5” (double)
  • “16” (double)
  • “20” (double)
  • “25” (double)
  • “31.5” (double)
  • “40” (double)
  • “50” (double)
  • “63” (double)
  • “80” (double)
  • “100” (double)
  • “125” (double)
  • “160” (double)
  • “200” (double)
  • “250” (double)
  • “315” (double)
  • “400” (double)
  • “500” (double)
  • “630” (double)
  • “800” (double)
  • “1k” (double)
  • “1.25k” (double)
  • “1.6k” (double)
  • “2k” (double)
  • “2.5k” (double)
  • “3.15k” (double)
  • “4k” (double)
  • “5k” (double)
  • “6.3k” (double)
  • “8k” (double)
  • “10k” (double)
  • “12.5k” (double)
  • “16k” (double)
  • “20k” (double)

[
{
"id": 2036150,
"timestamp": "2020-12-25 09:55:00",
"weight": "Z",
"12.5": 47.16,
"16": 48.59,
"20": 45.96,
"25": 49.1,
"31.5": 51.9,
"40": 48.88,
"50": 50.58,
"63": 51.82,
"80": 43.79,
"100": 39.01,
"125": 38.32,
"160": 37.48,
"200": 36.56,
"250": 36.03,
"315": 34.46,
"400": 33.05,
"500": 33.63,
"630": 32.98,
"800": 34.33,
"1k": 32.95,
"1.25k": 30.23,
"1.6k": 27.91,
"2k": 25.61,
"2.5k": 23.93,
"3.15k": 26.77,
"4k": 31.37,
"5k": 26.36,
"6.3k": 21.56,
"8k": 17.64,
"10k": 13.71,
"12.5k": 16,
"16k": 17.18,
"20k": 17.09
},
...
{
"id": 2036146,
"timestamp": "2020-12-31 23:59:00",
"weight": "Z",
"12.5": 49.01,
"16": 52.65,
"20": 47.69,
"25": 47.51,
"31.5": 48.42,
"40": 47.97,
"50": 47.64,
"63": 50.46,
"80": 43.36,
"100": 39.08,
"125": 38.59,
"160": 38.22,
"200": 36.42,
"250": 36.18,
"315": 34.13,
"400": 32.81,
"500": 33.16,
"630": 31.9,
"800": 32.83,
"1k": 32.08,
"1.25k": 30.15,
"1.6k": 27.52,
"2k": 24.7,
"2.5k": 23.17,
"3.15k": 30.31,
"4k": 32.6,
"5k": 29.94,
"6.3k": 20.79,
"8k": 15.76,
"10k": 14.41,
"12.5k": 16.23,
"16k": 17.27,
"20k": 17.08
}
]

GET /api/v1/API-TOKEN/terminals/TERMINAL-ID/cpb/average
http://domain.com/api/v1/B9LMXHTT7ZB2UIRZ9GTMY2/terminals/1/cpb/average
Returns the object “average” of all measurements’ CPB data for a specific terminal with the following properties:

  • “id” (integer)
  • “timestamp” (string)
  • “weight” (string)
  • “12.5” (double)
  • “16” (double)
  • “20” (double)
  • “25” (double)
  • “31.5” (double)
  • “40” (double)
  • “50” (double)
  • “63” (double)
  • “80” (double)
  • “100” (double)
  • “125” (double)
  • “160” (double)
  • “200” (double)
  • “250” (double)
  • “315” (double)
  • “400” (double)
  • “500” (double)
  • “630” (double)
  • “800” (double)
  • “1k” (double)
  • “1.25k” (double)
  • “1.6k” (double)
  • “2k” (double)
  • “2.5k” (double)
  • “3.15k” (double)
  • “4k” (double)
  • “5k” (double)
  • “6.3k” (double)
  • “8k” (double)
  • “10k” (double)
  • “12.5k” (double)
  • “16k” (double)
  • “20k” (double)
  • “number_of_logs” (int)

{
"timestamp_start": "2020-01-01 00:01",
"timestamp_end": "2020-12-31 23:59",
"weight": "Z",
"12.5": 68.96,
"16": 67.18,
"20": 65.32,
"25": 63.7,
"31.5": 61.59,
"40": 62.76,
"50": 63.46,
"63": 56.43,
"80": 52.49,
"100": 52.35,
"125": 52.67,
"160": 50.22,
"200": 47.93,
"250": 46.22,
"315": 46.17,
"400": 46.48,
"500": 44.52,
"630": 44.35,
"800": 43.06,
"1k": 41.82,
"1.25k": 40.49,
"1.6k": 39.47,
"2k": 39.53,
"2.5k": 37.77,
"3.15k": 39.37,
"4k": 36.61,
"5k": 36.38,
"6.3k": 35.48,
"8k": 33.93,
"10k": 33.32,
"12.5k": 44.77,
"16k": 47.64,
"20k": 27.73,
"number_of_logs": 525600
}

GET /api/v1/API-TOKEN/terminals/TERMINAL-ID/cpb/average/DATE-START
http://domain.com/api/v1/B9LMXHTT7ZB2UIRZ9GTMY2/terminals/1/cpb/average/2020-12-31
Returns the object “average” of all measurements’ CPB data for a specific terminal between DATE-START and today’s date with the following properties:

  • “id” (integer)
  • “timestamp” (string)
  • “weight” (string)
  • “12.5” (double)
  • “16” (double)
  • “20” (double)
  • “25” (double)
  • “31.5” (double)
  • “40” (double)
  • “50” (double)
  • “63” (double)
  • “80” (double)
  • “100” (double)
  • “125” (double)
  • “160” (double)
  • “200” (double)
  • “250” (double)
  • “315” (double)
  • “400” (double)
  • “500” (double)
  • “630” (double)
  • “800” (double)
  • “1k” (double)
  • “1.25k” (double)
  • “1.6k” (double)
  • “2k” (double)
  • “2.5k” (double)
  • “3.15k” (double)
  • “4k” (double)
  • “5k” (double)
  • “6.3k” (double)
  • “8k” (double)
  • “10k” (double)
  • “12.5k” (double)
  • “16k” (double)
  • “20k” (double)
  • “number_of_logs” (int)

{
"timestamp_start": "2020-01-01 00:01",
"timestamp_end": "2020-12-31 23:59",
"weight": "Z",
"12.5": 49.28,
"16": 50.95,
"20": 49.29,
"25": 50.99,
"31.5": 51.83,
"40": 51.96,
"50": 52.84,
"63": 51.34,
"80": 47.92,
"100": 49.36,
"125": 49.34,
"160": 43.33,
"200": 42.76,
"250": 42.52,
"315": 42,
"400": 40.32,
"500": 40.33,
"630": 40.48,
"800": 40.92,
"1k": 40.62,
"1.25k": 38.74,
"1.6k": 36.88,
"2k": 34.27,
"2.5k": 32.04,
"3.15k": 30.52,
"4k": 30.11,
"5k": 27.98,
"6.3k": 23.89,
"8k": 20.91,
"10k": 18.03,
"12.5k": 17.82,
"16k": 17.16,
"20k": 16.89,
"number_of_logs": 525600
}

GET /api/v1/API-TOKEN/terminals/TERMINAL-ID/cpb/average/DATE-START/DATE-END
http://domain.com/api/v1/B9LMXHTT7ZB2UIRZ9GTMY2/terminals/1/cpb/average/2020-12-25/2020-12-31
Returns the object “average” of all measurements’ CPB data for a specific terminal between DATE-START and DATE-END with the following properties:

  • “id” (integer)
  • “timestamp” (string)
  • “weight” (string)
  • “12.5” (double)
  • “16” (double)
  • “20” (double)
  • “25” (double)
  • “31.5” (double)
  • “40” (double)
  • “50” (double)
  • “63” (double)
  • “80” (double)
  • “100” (double)
  • “125” (double)
  • “160” (double)
  • “200” (double)
  • “250” (double)
  • “315” (double)
  • “400” (double)
  • “500” (double)
  • “630” (double)
  • “800” (double)
  • “1k” (double)
  • “1.25k” (double)
  • “1.6k” (double)
  • “2k” (double)
  • “2.5k” (double)
  • “3.15k” (double)
  • “4k” (double)
  • “5k” (double)
  • “6.3k” (double)
  • “8k” (double)
  • “10k” (double)
  • “12.5k” (double)
  • “16k” (double)
  • “20k” (double)
  • “number_of_logs” (int)

{
"timestamp_start": "2020-12-25 00:00",
"timestamp_end": "2020-12-31 23:59",
"weight": "Z",
"12.5": 56.76,
"16": 54.98,
"20": 53.12,
"25": 53.88,
"31.5": 51.31,
"40": 60.16,
"50": 61.98,
"63": 56.95,
"80": 49.86,
"100": 48.04,
"125": 48.81,
"160": 45.24,
"200": 43.43,
"250": 42.67,
"315": 43.22,
"400": 42.05,
"500": 41,
"630": 42.43,
"800": 41.49,
"1k": 40.53,
"1.25k": 38.74,
"1.6k": 37.34,
"2k": 35.56,
"2.5k": 33.81,
"3.15k": 32.76,
"4k": 30.67,
"5k": 29.22,
"6.3k": 27.4,
"8k": 26.04,
"10k": 22.18,
"12.5k": 20.71,
"16k": 18.7,
"20k": 17.05,
"number_of_logs": 8640
}

Live data


<!DOCTYPE HTML>

<html>
<head>

<script type = “text/javascript”>
function WebSocketTest() {

if (“WebSocket” in window) {
let ws = new WebSocket(“ws://89.212.142.244:8000/socket.io/?transport=websocket&token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiIsImp0aSI6IjRmMWcyM2ExMmFhIn0.eyJpc3MiOiJodHRwOlwvXC9sb2NhbGhvc3QiLCJqdGkiOiI0ZjFnMjNhMTJhYSIsImlhdCI6MTYwNzkzNjkzNCwiZXhwIjoxNjA4MDIzMzM0LCJvcmdpZCI6MSwidHlwZSI6ImFwaUNsaWVudCIsImlkIjoyfQ.bQNJyy4pcIycDFkgwpXVzwcITDsi7z4k0ur-LTmRBAA&terminal=0szvAszzc3rjqYG68UPWDWBjbU6RbMKH”);

ws.onopen = function() {
console.log(“Socket connection opened”);
//ws.send(“Message to send”);
};

ws.onmessage = function (evt) {
let received_msg = evt.data;
console.log(“Socket msg: ” + received_msg);
};

ws.onclose = function() {
console.log(“Socket connection closed”);
};

setInterval(function () {
ws.send(’42[“ping”, “”]’);
}, 10000);
} else {
alert(“WebSocket NOT supported by your Browser!”);
}
}
</script>

</head>

<body>
<div id = “sse”>
<a href = “javascript:WebSocketTest()”>Run WebSocket</a>
</div>

</body>
</html>