Exporting Data
How to export data from the BioT platform
BioT enables to export data out of the platform to be used for any mean, and especially by external BI and analysis tools.
Export Process
- Make a "Create Report" API call
- Wait for the report to be created (BioT will send a notification about it to a callback URL you provide in the "Create Report" call).
- Download the data
Enable ExportTo save costs the export feature is not enabled by default.
If you require this feature please contact us and we will enable it for you.
Make a "Create Report" API call
To create the report make the following API call:
POST https://example.com/dms/v1/data/reports/export
Body:
{
"queries": [
{
"dataType": "device",
"filter": {
"_creationTime": {
"from": "2023-04-02T13:13:05.703Z",
"to": "2023-04-03T13:13:05.703Z"
},
"_lastModifiedTime": {
"from": "2023-04-02T13:13:05.703Z",
"to": "2023-04-03T13:13:05.703Z"
},
"_templateId": {
"in": [
"456171e0-78ba-4991-995f-e8488b68041b"
]
}
},
"sort": [
{
"prop": "_creationTime",
"order": "ASC"
}
]
}
],
"outputMetadata": {
"maxFileSizeInBytes": 1000000000,
"exportFormat": "JSON"
},
"callbackEndpoint": "https://my-url.com/"
}
Parameter | Description | Example |
---|---|---|
queries | String | JSON array |
dataType | String | String |
filter.prop1 | String | possible values:
|
sort.prop | String | possible values:
|
sort.order | String | possible values: |
outputMetadata.maxFileSizeInBytes | Number | Example: |
exportFormat | String | possible values: |
callbackEndpoint | String/URL | Example: |
The API will return:
{
"queries": [
{} // Copy of the request
],
"outputMetadata": {
"maxFileSizeInBytes": 1000000000,
"exportFormat": "JSON"
},
"callbackEndpoint": "https://my-url.com/",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"status": "IN_PROGRESS",
"fileOutput": {
"filesLocation": {
"additionalProp1": {},
"additionalProp2": {},
"additionalProp3": {}
},
"urlExpirationTime": "2007-12-20T10:15:30Z"
},
"reportInitiator": {
"userId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"ownerOrganizationId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"userEntityType": "string",
"templateId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
}
Wait for the report to be created
The report will be created asynchronously and depending on the size of it it might take a long time to be created.
You can determine if the report is ready in 2 ways:
- Wait for BioT to make a call back to the URL you supplied in the request.
- Poll BioT to check if the report is ready.
To poll make the following API call:
GET https://example.com/dms/v1/data/reports/{id}
Use the report ID from the Create Report response.
In the response check thestatus
attribute.
If the status isCOMPLETED
then the report is ready to be downloaded.
Download the data
To download the data make the API call mentioned in the previous section.
Use the fileOutput
object to download the report.
The report will hold a list of files to download.
Updated 1 day ago