openapi: 3.2.0 info: version: '2.0' title: ZENSIE Data API servers: - url: https://api.30mhz.com/api tags: - name: Data paths: /data/sensors: post: tags: - Data summary: Retrieves data for a given field of a set of sensors description: '' operationId: getDataForSensors security: - Bearer: [] responses: '200': description: Returns sensors info along with the values per timestamp. content: application/json: schema: $ref: '#/components/schemas/SensorsDataResponse' application/zensie-v2+json: schema: $ref: '#/components/schemas/SensorsDataResponse' '403': description: Unauthorized access to the data '404': description: Sensors not found. requestBody: content: application/json: schema: $ref: '#/components/schemas/SensorsDataRequest' components: schemas: EventHook: type: object required: - method - url properties: headers: type: object description: Headers of the HTTP request additionalProperties: type: object method: type: string description: Method of the HTTP request payload: type: object description: Payload of the HTTP request additionalProperties: type: object url: type: string description: Url of the HTTP request SharedByUserDetails: type: object properties: firstName: type: string lastName: type: string CalculationSettings: type: object required: - inputParams properties: calculationId: type: string description: Unique identifier for the calculation inputParams: type: object description: A map of the necessary input parameters and their type for performing the calculation additionalProperties: type: object description: Settings used to perform a calculation. SensorsDataResponse: type: object required: - time properties: aggregations: type: array items: $ref: '#/components/schemas/SensorsDataAggregation' time: $ref: '#/components/schemas/Time' data: type: array items: $ref: '#/components/schemas/SensorsData' SharedSensorType: type: object properties: createdAt: type: string description: The date and time a sensor type was shared. organizationId: type: string description: ID of the organization to which the shared sensor type belongs organizationName: type: string sensorTypeId: type: string description: Id of the original sensor type sharedByUser: type: string description: User who shared the sensor type sharedByUserDetails: $ref: '#/components/schemas/SharedByUserDetails' sharedSensorTypeId: type: string description: Id of the shared sensor type itself sharedWithGroupId: type: string description: Group which the sensor type has been shared with sharedWithGroupName: type: string sharedWithOrganizationId: type: string description: Organization which the sensor type has been shared with sharedWithOrganizationName: type: string sharedWithUser: type: string description: User who the sensor type has been shared with sharedWithUserDetails: $ref: '#/components/schemas/SharedWithUserDetails' SensorType: type: object required: - decimals - description properties: batteryVoltageChargedEnough: type: string batteryVoltageCritical: type: string batteryVoltageWarning: type: string canSleep: type: boolean description: States if this sensor is able to sleep chartColor: type: string color: type: string createdAt: type: string dataTypes: type: array description: The data types of the json keys (long, double, boolean, string items: type: string decimals: type: integer format: int32 description: type: string enums: type: array description: The enums (if any) in the sensor data items: $ref: '#/components/schemas/SensorTypeEnumData' external: type: boolean description: States if the sensor type is external hasVoltageInformation: type: boolean icon: type: string description: Embedded html that displays the sensor type's icon. iconId: type: string description: Identifier of the sensor type's icon asset. isBillable: type: boolean description: States if the sensor type is billable or not. isForManualInput: type: boolean description: States if the sensor type is for manual input jsonKeys: type: array items: type: string jsonLabels: type: array items: type: string metadata: type: string description: Describes sensor metadata metrics: type: array items: type: string name: type: string notificationTemplates: type: array description: Notification templates items: $ref: '#/components/schemas/NotificationTemplate' organizationId: type: string productionStatus: type: string description: Production status of the sensor enum: - ACTIVE - INACTIVE - OBSOLETE - OUTGOING queryParameters: type: object additionalProperties: type: array items: type: string queryParametersRequired: type: boolean description: States if the query parameters are required radioId: type: string description: Radio identifier rangeMax: type: string description: Maximum sensor values rangeMin: type: string description: Minimum sensor values typeId: type: string sharedDetails: $ref: '#/components/schemas/SharedSensorType' description: Authorization entity Sensor: type: object required: - notificationIds properties: notifications: type: array items: $ref: '#/components/schemas/Notification' checkId: type: string organizationId: type: string siteId: type: string dataSourceCoordinateHistory: type: array items: $ref: '#/components/schemas/DataSourceCoordinates' dataSourceCoordinates: $ref: '#/components/schemas/DataSourceCoordinates' decimalsPerField: type: object additionalProperties: type: integer format: int32 notificationIds: type: array items: type: string name: type: string description: type: string tags: type: array uniqueItems: true items: type: string enabled: type: boolean status: type: string enum: - ACTIVE - DEACTIVATED - PAUSED rangePerJsonKey: type: object additionalProperties: type: array items: type: number format: double sensorType: type: string timezone: type: string zoneId: type: string SensorField: type: object properties: checkId: type: string description: The id of the check this field belongs to. id: type: string description: Which field of the sensor to retrieve data for. unit: type: string description: The unit in which to retrieved the values. Defaults to system unit. SharedWithUserDetails: type: object properties: firstName: type: string lastName: type: string Time: type: object required: - end - start properties: end: type: string format: date-time description: Time range exclusive end in ISO 8601 format without timezone, e.g., '2023-03-06T00:00:00'. resolution: type: string description: Interval size of the requested data points. Allowed values are [m, 5m, h, d, w, M]. Defaults to d. start: type: string format: date-time description: Time range start in ISO 8601 format without timezone, e.g., '2023-03-06T00:00:00'. timezone: type: string description: Timezone of the provided time range. Defaults to sensors timezone. SensorTypeEnumDataMapping: type: object properties: color: type: string label: type: string value: type: integer format: int32 SensorTypeEnumData: type: object properties: key: type: string mappings: type: array items: $ref: '#/components/schemas/SensorTypeEnumDataMapping' CheckCollection: type: object properties: collectionId: type: string description: Id of the collection name: type: string description: Name of the collection order: type: integer format: int32 description: The position within all the collections SensorsDataAggregation: type: object properties: aggregationType: type: string description: The type of aggregation to apply to the retrieved values. sensorFields: type: array items: $ref: '#/components/schemas/SensorField' sensorIds: type: array description: Ids of the sensors to get data for. They must be of the same type. items: type: string DataSourceCoordinates: type: object required: - dataSourceId - sinceDate properties: coordinateX: type: number format: double description: X coordinate in space coordinateY: type: number format: double description: Y coordinate in space sinceDate: type: string description: UTC ISO 8601 timestamp since when, e.g 2024-11-12T15:00:00Z. dataSourceId: type: string description: Identifier of the data source geoJson: type: object description: GeoJson definition. additionalProperties: type: object zoneName: type: string description: Name of the zone zoneUuid: type: string description: Unique identifier of the zone description: Coordinates of a data source since a given timestamp. StructuredConditional: type: object properties: aggregationType: type: string description: The type of aggregation. checkFields: type: array description: List of fields represented by the check id and field name items: $ref: '#/components/schemas/SensorField' interval: type: string description: The time interval to aggregate over. key: type: string description: Key of the structured conditional operator: type: string description: Operator of the conditional operatorType: type: string description: Operator type of the conditional enum: - COMPARISON - LOGICAL value: type: string description: Value of the key given the operator Notification: type: object required: - notificationId properties: action: type: string description: Description of the action to take when the notification is triggered. calculationSettings: description: The calculation configuration $ref: '#/components/schemas/CalculationSettings' checkId: type: string description: Identifier of the check. condition: type: string description: Conditional that defines the trigger of this notification description: type: string description: Description of the notification eventHook: description: Event hook of the notification $ref: '#/components/schemas/EventHook' matchAfter: type: integer format: int32 description: Match after attribute minimum: 0 throttleFor: type: integer format: int64 description: The amount of time in milliseconds to throttle notifications minimum: 0 check: description: Summary of the check that is linked to this notification $ref: '#/components/schemas/CheckSummary' createdBy: type: string description: Identifier of the user that created this notification creationTimestamp: type: integer format: int64 description: Timestamp of when the notification was created matched: type: boolean description: Matched attribute matchedFor: type: integer format: int32 description: Matched for attribute matchedLastNotifiedAt: type: integer format: int64 description: When the last matched notification was sent notificationId: type: string description: Identifier of this notification object. nrMatched: type: integer format: int32 description: Number of matches attribute organizationId: type: string description: Identifier of the organization for which this notification is created resolvedLastNotifiedAt: type: integer format: int64 description: When the last resolved notification was sent structuredConditional: type: array description: List of structured conditionals that defines the trigger event of this notification. items: $ref: '#/components/schemas/StructuredConditional' widgetIds: type: array description: List of structured conditionals that defines the trigger event of this notification. uniqueItems: true items: type: string description: Holds the editable properties of a Notification SensorsDataRequest: type: object required: - time properties: aggregations: type: array items: $ref: '#/components/schemas/SensorsDataAggregation' time: $ref: '#/components/schemas/Time' SensorFieldInfo: type: object properties: checkId: type: string description: The id of the check this field belongs to. id: type: string description: Which field of the sensor to retrieve data for. unit: type: string description: The unit in which to retrieved the values. Defaults to system unit. symbol: type: string CheckSummary: type: object properties: calculationSettings: $ref: '#/components/schemas/CalculationSettings' checkId: type: string collections: type: array items: $ref: '#/components/schemas/CheckCollection' cultivationHierarchyId: type: string decimalsPerField: type: object additionalProperties: type: integer format: int32 enabled: type: boolean locations: type: array uniqueItems: true items: type: string maxDecimals: type: integer format: int32 name: type: string organizationId: type: string rangePerJsonKey: type: object additionalProperties: type: array items: type: number format: double sensorType: type: string timezone: type: string timezoneOffset: type: integer format: int64 units: type: array uniqueItems: true items: type: string description: Summary of a check NotificationTemplate: type: object properties: condition: type: string frontend: type: string name: type: string SensorsData: type: object properties: sensorFields: type: array items: $ref: '#/components/schemas/SensorFieldInfo' sensorType: $ref: '#/components/schemas/SensorType' sensors: type: array items: $ref: '#/components/schemas/Sensor' values: type: object additionalProperties: type: object securitySchemes: Bearer: description: '' type: apiKey name: Authorization in: header