Device Data Retrieval from AtlatoDB#
Data retrieval occurs in two forms: live data, which provides real-time information, and historical data, which offers a record of past information.Live Data#
To obtain live data from the system, follow these steps:1.
Create Socket Connection:Establish a socket connection to the server.
2.
Subscribe to the 'data' event to receive real-time updates.
3.
Provide a list of device IDs as an array parameter to specify which devices' data you wish to observe.
data: The data object is a key component of the API response, encapsulating detailed information about each data packet received from the devices. Below is a detailed description of the attributes contained within the data object.raw: An object that contains the raw data received from the device. This data is saved according to Device Input Names. converted: An object that contains the converted data. This data is also saved according to Device Input Names. err: An object that represents any errors in the data packet.
serial: The IMEI number of the device, which uniquely identifies the device.
deviceId: The ID of the device.
timestamp: The timestamp indicating when the data was received.
dId :The ID of the device, represented as deviceId.
Historical Data#
To retrieve historical data from the system, follow these steps:1.
Content-Type: application/json
2.
Request Body:
Include the following parameters in the JSON body of your POST request:{
"deviceId": "string",
"fromDate": "YYYY-MM-DD HH:mm:ss",
"toDate": "YYYY-MM-DD HH:mm:ss",
}
deviceId
: (Required) The ID of the device for which you want to retrieve historical data.
fromDate
: The start time for the historical data range in "YYYY-MM-DD HH:mm" format.
toDate
: The end time for the historical data range in "YYYY-MM-DD HH:mm" format.Duration Limitation: The duration between fromDate and toDate must be less than 7 days.
3.
data
: Array containing historical data filtered by the specified start and end times.
message
: A string message providing additional information about the request or any errors.
data: An array of objects, each representing a data packet received from a device. Each object within the data array contains the following properties.raw: An object that contains the raw data received from the device. This data is saved according to Device Input Names. converted: An object that contains the converted data. This data is also saved according to Device Input Names. err: An object that represents any errors in the data packet.
timestamp: The timestamp indicating when the data was received.
message: A string that represents the response message of the request. It provides a status or result summary of the API call.
Definitions#
Term | Definition |
---|
deviceId | The deviceId serves as a unique identifier assigned to each device upon its installation within our system. This identifier is generated by the Atlato system during the device registration process. It is essential for specifying the particular device for which data retrieval or operational commands are intended in API requests. |
JWT Token | "JWT Token" stands for JSON Web Token. It is a compact and self-contained method for securely transmitting information between parties as a JSON object. JWTs can be used to authenticate users and securely transmit information over the network. They consist of three parts: a header, a payload, and a signature, which are encoded and can be digitally signed. |
Modified at 2024-10-09 11:41:37