Query Time Series Data
Endpoint
URL | http://capture-vintecc.com/api/data |
METHOD | GET |
Headers
Header | Value |
---|---|
AuthVersion | V0.0.1 |
Authorization | Bearer <Received auth token> |
Parameters (Query String)
Parameter | Reason |
---|---|
Query | Url encoded influxdb query (see example) |
Db | Name of the database (*TimescaleDB => schema name) |
OutputType | 0 (default) = JSON, 1 = CSV |
DbRoot * | TimescaleDB root db of your scheme (Default Vintecc => TimescaleDb database name) |
DbType * | 0 (default) = Influxdb, 1 = TimescaleDB |
TimeOutput ** | 0 (default) = human readable format dd/MM/yyyy HH:mm:ss.FFF , 1 = epoch format 1625472591787000000 (nanoseconds since since January 1, 1970) |
Blob | |
BlobFields (Optional) | List of fields within the query result to fetch from Azure blob storage. Adding this parameter will result in a new parameter in the result called [original_field]_content. This will contain a base64 representation of the image |
ImageBlobWidth (Optional) | Transforms the base64 content so that the width of the resulting image is the input, if no height is passed, the aspect ratio will be respected |
ImageBlobHeight (Optional) | Transforms the base64 content so that the height of the resulting image is the input, if no width is passed, the aspect ratio will be respected |
ImageBlobQuality (Optional) | Transforms the base64 content so that the quality of the resulting image is the input. This can drastically reduce the size of the result. |
* Only necessary when using TimescaleDB
** Time output in human readable format only works for JSON output
** Time is always returned in UTC time
Examples
Query:
SELECT%20%22TestField%22%20from%20%22fiveYears%22.%22TestMeasurement%22%20LIMIT%203
URL Decoded:
SELECT "TestField" from "fiveYears"."TestMeasurement" LIMIT 3
JSON Response:
{
"metrics": [
{
"name": "TestMeasurement",
"tags": {
"SerialNumber": "00AF123B"
},
"fields": {
"TestField": 50.05469
},
"timestamp": "09/09/2020 07:50:56.100"
},
{
"name": "TestMeasurement",
"tags": {
"SerialNumber": "00AF123B"
},
"fields": {
"TestField": 49.66406
},
"timestamp": "09/09/2020 07:51:38.125"
},
{
"name": "TestMeasurement",
"tags": {
"SerialNumber": "00AF123B"
},
"fields": {
"TestField": 49.56641
},
"timestamp": "09/09/2020 07:52:02.450"
}
],
"timestamp": "09/09/2020 13:51:49.126"
}
info
In case the BlobFields are set, the result contains extra fields. These fields are the BlobFields appended with "_content", containing the values as fetched from the ImageProvider (base64).
Example: "FieldName_content": "data:image/jpeg;base64,/9j/4AAQSkZJ..."
CSV Response:
name;tags;time;SerialNumber;TestField
TestMeasurement;;1624515913129000000;00AF123B;50.05469
TestMeasurement;;1624515914125000000;00AF123B;49.66406
TestMeasurement;;1624515918450000000;00AF123B;49.56641
Special fields:
name | name of the measurement |
tags | shows all series (group by combinations) => Example: Group by SerialNumber *** |
***
name;tags;time;SerialNumber;TestField
TestMeasurement;SerialNumber=00AF123B;1624515913129000000;00AF123B;50,05469
TestMeasurement;SerialNumber=00AF123B;1624515914125000000;00AF123B;49,66406
TestMeasurement;SerialNumber=00AF123B;1624515918450000000;00AF123B;49,56641