Data Sessions
The following endpoint only applies to BACE GO device
Last updated
The following endpoint only applies to BACE GO device
Last updated
This endpoint in only applicable for BACE GO. Not sure which device you are working with? Find out here.
Whenever a BACE Go is turned on, a Data Session is created automatically in the BACE cloud. The Data Session is automatically closed when the device is turned off.
The BACE API for Data Sessions allows you to:
Get information about the Data Session
Get information about the device reporting data
Get all data associated with Data Session
To start getting Data Sessions data from the BACE API, you must have:
An active User account
A physical or virtual device (able to start/stop Data Session) provisioned and related to your project
(Optionally) a peripheral or sensor connected to your BACE device
To retrieve data from a data session, two request are required:
List all Data Sessions
Get specific data from session
Download full session in CSV file
To get list of all Data Sessions in the system available for you, you should make a GET request
GET
https://
dashboard.bace-iot.com/api/v2/data-session?sort=-star
In our example we will sort Data Sessions on start time descending, such that the latest Data Sessions that was started is in the beginning of the list.
In the response you will get basic information about all Data Sessions. You have access to the following fields:
id_data_session
UUID of the Data session
id_group
UUID of the Group device is in. To get more information use: expand=group
id_person
UUID of the Person related to the Datasession
label
Descriptive label for the datasession
start
Data session start timestamp in seconds
end
Data session end timestamp in seconds. null - if Data session is active and not stopped
created_at
Timestamp in seconds, when Data sessions record have been created
created_by
UUID of the User, who have created Data session. For Data session started from the device - null. To get more information use: expand=creator
updated_at
Timestamp in seconds, when Data sessions record have been last updated
updated_by
UUID of the User, who have last updated Data session. For Data session updated from the device - null. To get more information use: expand=updater
archived_at
Timestamp in seconds, when Data session have been archived
datapoint_count
Total datapoint count in the Data session
isIngestionFinished
Boolean describing data ingestion process
isArchived
Boolean describing, if archiving of Data session have been finished
To get specific data associated with a Data Session. You should make a GET request from the data-downsampled
endpoint, specifiying the session ID.
GET
https://dashboard.bace-iot.com/api/v2/data-downsampled?filter[id_data_session]=ID_DATA_SESSION
Example response:
id_container_data_latest
UUID which describes combination of Group, Physical Device and Datatype
id_group
UUID of Group
datatype
Datatype of stored data
source_device
UUID of Physical Device, BACE Cloud have received data from
timestamp_seconds
Timestamp in seconds
min_val
Minimal value
max_val
Maximal value
avg_val
Average value
count_val
Count of downsampled samples
If data is downsampled, the field count_val is greater than 1. In this case, you can also request data between 2 timestamps to get data with a higher resolution, i.e. more datapoints.
More information about downsampling mechanism and how to use data-downsampled endpoint
To download the complete Data Session in a CSV file, you should make GET request from the download-csv endpoint.
GET
https://dashboard.bace-iot.com/api/v2/data-session/ID_DATA_SESSION/download-csv