openapi: 3.2.0 info: version: '2.0' title: ZENSIE Import Check API servers: - url: https://api.30mhz.com/api tags: - name: import-check paths: /import-check/date-entry/{dateEntryId}: delete: tags: - import-check summary: Delete a date entry description: Authentication required for this operation, authenticated user has admin role or is owner/editor of an organization. operationId: deleteCheckDateEntry parameters: - name: dateEntryId in: path required: true schema: type: string security: - Bearer: [] responses: '200': description: Date entry deleted '403': description: Not enough permissions to perform the operation '404': description: Date entry not found /import-check/{checkId}: get: tags: - import-check summary: Returns the import check with the specified check id description: Authentication required and user has read access to the organization. operationId: getImportCheck parameters: - name: checkId in: path required: true schema: type: string security: - Bearer: [] responses: '200': description: The import check with the specified id content: application/json: schema: $ref: '#/components/schemas/ImportCheck' application/zensie-v2+json: schema: $ref: '#/components/schemas/ImportCheck' '401': description: Unauthenticated request, cannot perform operation '403': description: User is not authorized to perform this operation. '404': description: An import check with that id does not exist '500': description: Error obtaining the import check persisted data delete: tags: - import-check summary: Delete an import check description: Authentication required for this operation, authenticated user has admin role or is owner of an organization. operationId: deleteImportCheck parameters: - name: checkId in: path required: true schema: type: string security: - Bearer: [] responses: '200': description: Import check has been removed. '403': description: User is not authorized to perform this operation. Should be admin or organization owner. '404': description: Import check not found. /import-check/{checkId}/collection/{collectionId}: delete: tags: - import-check summary: Delete a collection from an import check description: Authentication required for this operation, authenticated user has admin role or is owner/editor of an organization. operationId: deleteImportCheckCollection parameters: - name: checkId in: path required: true schema: type: string - name: collectionId in: path required: true schema: type: string security: - Bearer: [] responses: '201': description: Collection deleted from to the import check content: application/json: schema: $ref: '#/components/schemas/ImportCheck' application/zensie-v2+json: schema: $ref: '#/components/schemas/ImportCheck' '400': description: Invalid properties '403': description: Not enough permissions to perform the operation '404': description: An import check with that id doesn't exist /import-check/{checkId}/manual-input-data/{rowId}: delete: tags: - import-check summary: Delete manual input data row description: Authentication required for this operation. operationId: deleteManualInputRowById parameters: - name: checkId in: path required: true schema: type: string - name: rowId in: path required: true schema: type: string security: - Bearer: [] responses: '202': description: Manual input data row is deleted. '400': description: Bad request while deleting row '403': description: Not enough permissions to perform the operation. /import-check/organization/{organizationId}: get: tags: - import-check summary: Return all the import checks of the given organization description: Authentication required and user is at least a follower in the organization, or is an admin in the system. operationId: getAllByOrganizationId parameters: - name: organizationId in: path required: true schema: type: string - name: search in: query description: Search for checks by name, url or check id required: false schema: type: string - name: tags in: query description: Filter checks by tags (separate with comma) required: false schema: type: string - name: tagsoperator in: query description: How should checks by filtered by tags (or / and)? required: false schema: type: string - name: sensortype in: query description: Filter checks by sensortype required: false schema: type: string - name: expandCoordinates in: query description: Include data source coordinates information required: false schema: type: boolean - name: expandCoordinateHistory in: query description: Include coordinate history for each data source (may increase response size) required: false schema: type: boolean security: - Bearer: [] responses: '200': description: List of checks returned content: application/json: schema: type: array items: $ref: '#/components/schemas/ImportCheck' application/zensie-v2+json: schema: type: array items: $ref: '#/components/schemas/ImportCheck' '403': description: User is not authorized to perform this operation. post: tags: - import-check summary: Create a new import check in the organization description: 'Authentication required for this operation. Preconditions: Authenticated user has to be editor or owner of the organization, or be an admin in the platform. Authenticated user is an owner within the organization or an admin. The check id will be generated and the whole new saved check is returned.' operationId: createImportCheck parameters: - name: organizationId in: path required: true schema: type: string security: - Bearer: [] responses: '201': description: New import check created, including its generated check id content: application/json: schema: $ref: '#/components/schemas/ImportCheck' application/zensie-v2+json: schema: $ref: '#/components/schemas/ImportCheck' '400': description: Name, sensor type is empty or invalid data in one or more of the check properties. '403': description: Not enough permissions to perform the operation requestBody: content: application/json: schema: $ref: '#/components/schemas/ImportCheck' /import-check/{checkId}/date-entry: get: tags: - import-check summary: Get all date entries that belong to an import check description: Authentication required for this operation, authenticated user has admin role or is a member of the organization. operationId: getDateEntriesForImportCheck parameters: - name: checkId in: path required: true schema: type: string security: - Bearer: [] responses: '201': description: Retrieved data entries for import check content: application/json: schema: type: array items: $ref: '#/components/schemas/CheckDateEntry' application/zensie-v2+json: schema: type: array items: $ref: '#/components/schemas/CheckDateEntry' '400': description: Invalid date entry properties. '403': description: Not enough permissions to perform the operation '404': description: An import check with that id doesn't exist post: tags: - import-check summary: Create a new date entry that belongs to an import check description: Authentication required for this operation, authenticated user has admin role or is owner/editor of an organization. operationId: addImportCheckDateEntry parameters: - name: checkId in: path required: true schema: type: string security: - Bearer: [] responses: '201': description: New date entry created content: application/json: schema: $ref: '#/components/schemas/CheckDateEntry' application/zensie-v2+json: schema: $ref: '#/components/schemas/CheckDateEntry' '400': description: Invalid date entry properties. '403': description: Not enough permissions to perform the operation '404': description: An import check with that id doesn't exist requestBody: content: application/json: schema: $ref: '#/components/schemas/NewCheckDateEntry' /import-check/{checkId}/collection/{collectionId}/stats: get: tags: - import-check summary: Get values for a given collection in a check description: Authentication required for this operation, authenticated user has admin role or is owner/editor of an organization. operationId: getImportCheckCollectionValues parameters: - name: checkId in: path required: true schema: type: string - name: collectionId in: path required: true schema: type: string security: - Bearer: [] responses: '200': description: Collection values content: application/json: schema: type: array items: $ref: '#/components/schemas/ManualImportCheckStatsResponse' application/zensie-v2+json: schema: type: array items: $ref: '#/components/schemas/ManualImportCheckStatsResponse' '400': description: Invalid properties '403': description: Not enough permissions to perform the operation '404': description: An import check with that id doesn't exist /import-check/date-entry/{dateEntryId}/stats: get: tags: - import-check summary: Get values for a date entry description: Authentication required for this operation, authenticated user has admin role or is owner/editor of an organization. operationId: getImportCheckDateEntryValues parameters: - name: dateEntryId in: path required: true schema: type: string security: - Bearer: [] responses: '200': description: Date entry values content: application/json: schema: type: array items: $ref: '#/components/schemas/ManualImportCheckStatsResponse' application/zensie-v2+json: schema: type: array items: $ref: '#/components/schemas/ManualImportCheckStatsResponse' '400': description: Invalid properties '403': description: Not enough permissions to perform the operation '404': description: A date entry with that id doesn't exist /import-check/{check-id}/manual-input-data: get: tags: - import-check summary: Get data for a manual input check description: Authentication required for this operation operationId: getManualInputDataForCheck parameters: - name: check-id in: path required: true schema: type: string security: - Bearer: [] responses: '200': description: Manual input data content: application/json: schema: $ref: '#/components/schemas/PaginatedManualInputRows' application/zensie-v2+json: schema: $ref: '#/components/schemas/PaginatedManualInputRows' '400': description: Invalid properties '403': description: Not enough permissions to perform the operation '404': description: A check with that id doesn't exist /import-check/{checkId}/date-entries: post: tags: - import-check summary: Add new date entries to an import check description: Authentication required for this operation, authenticated user has admin role or is owner/editor of an organization. operationId: addDateEntries parameters: - name: checkId in: path required: true schema: type: string security: - Bearer: [] responses: '201': description: New date entries created content: application/json: schema: type: array items: $ref: '#/components/schemas/CheckDateEntry' application/zensie-v2+json: schema: type: array items: $ref: '#/components/schemas/CheckDateEntry' '400': description: Invalid date entry properties. '403': description: Not enough permissions to perform the operation '404': description: An import check with that id doesn't exist requestBody: content: application/json: schema: type: array items: $ref: '#/components/schemas/CheckDateEntry' /import-check/{checkId}/collection: post: tags: - import-check summary: Add collections to an import check description: Authentication required for this operation, authenticated user has admin role or is owner/editor of an organization. operationId: addImportCheckCollections parameters: - name: checkId in: path required: true schema: type: string security: - Bearer: [] responses: '201': description: New collections added to the import check content: application/json: schema: type: array items: $ref: '#/components/schemas/CheckCollection' application/zensie-v2+json: schema: type: array items: $ref: '#/components/schemas/CheckCollection' '400': description: Invalid collection properties. '403': description: Not enough permissions to perform the operation '404': description: An import check with that id doesn't exist requestBody: content: application/json: schema: type: array items: $ref: '#/components/schemas/NewCheckCollection' /import-check/copy/{checkId}/organization/{destinationOrganizationId}: post: tags: - import-check summary: Copy an external sensor into the organization. description: 'Authentication required for this operation. Preconditions: Authenticated user has to be an admin in the platform. The check id will be generated and the new check is returned.' operationId: copyImportCheckIntoOrganization parameters: - name: checkId in: path required: true schema: type: string - name: destinationOrganizationId in: path required: true schema: type: string security: - Bearer: [] responses: '201': description: New import check created, including its generated check id content: application/json: schema: $ref: '#/components/schemas/ImportCheck' application/zensie-v2+json: schema: $ref: '#/components/schemas/ImportCheck' '400': description: Attempting to share or copy a public sensor type. '403': description: Not enough permissions to perform the operation requestBody: content: application/json: schema: $ref: '#/components/schemas/SensorCopyOverrides' 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 NewCheckDateEntry: type: object properties: checkId: type: string description: Id of the check it belongs to date: type: string description: Date of the entry dateEntryId: type: string description: Id of the date entry name: type: string description: The name of the date entry deletedAt: type: string Pagination: type: object properties: lastPage: type: integer format: int64 page: type: integer format: int32 size: type: integer format: int32 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. 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. NewCheckCollection: type: object properties: name: type: string description: Name of the collection ManualImportCheckStatsResponse: type: object required: - data properties: collectionId: type: string data: type: object dateEntryId: type: string id: type: string ExternalSensorEditable: type: object properties: calculationSettings: description: The calculation settings if this is a calculation data source. $ref: '#/components/schemas/CalculationSettings' dataSourceCoordinatesEditable: description: A set of numbers that represent the current position of a data source $ref: '#/components/schemas/DataSourceCoordinatesEditable' decimalsPerField: type: object description: The number of decimals used for each field of the data source. additionalProperties: type: integer format: int32 description: type: string description: Brief description that elaborates on the name enabled: type: boolean description: Whether the data source is enabled. ingestedForIndices: type: object description: The data source's indexes for ingested values additionalProperties: type: array items: type: string integrationType: type: string description: Integration type. locationId: type: string description: Identifier of the site it belongs to, together with the organizationId this is unique. name: type: string description: Displayable name. notificationRelevance: type: integer format: int32 description: The notification relevance for import check hits. minimum: 300 rangePerJsonKey: type: object description: Min/max ranges for each json key of the data source. additionalProperties: type: array items: type: number format: double sensorType: type: string description: The sensor type. sourceId: type: string description: Optional source id. status: type: string description: The status of the data source, e.g. ACTIVE, DEACTIVATED or PAUSED. enum: - ACTIVE - DEACTIVATED - PAUSED tags: type: array description: The tags associated with the data source. uniqueItems: true items: type: string timezone: type: string description: An area which observes a uniform standard time. unitPerField: type: object description: Identifier of the preferred unit conversion for each field. additionalProperties: type: string useCollectionsAsRows: type: boolean description: Whether collections should be displayed as rows. zoneId: type: string description: Identifier of the zone within a site where the data source belongs. siteId: type: string description: Identifier of the site it belongs to, together with the organizationId this is unique. DataSourceCoordinatesEditable: type: object 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. description: Object containing the editable properties of DataSourceCoordinates. PaginatedManualInputRows: type: object properties: data: type: array items: $ref: '#/components/schemas/ManualInputRow' pagination: $ref: '#/components/schemas/Pagination' 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' ManualInputRow: type: object properties: rowId: type: string timestamp: type: integer format: int64 values: type: object CheckDateEntry: type: object properties: checkId: type: string description: Id of the check it belongs to date: type: string description: Date of the entry dateEntryId: type: string description: Id of the date entry name: type: string description: The name of the date entry deletedAt: type: string 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 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 SensorTypeUpdate: type: object 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 dataTypes: type: array items: type: string decimals: type: integer format: int32 minimum: 0 description: type: string enums: type: array items: $ref: '#/components/schemas/SensorTypeEnumData' external: type: boolean hasVoltageInformation: type: boolean icon: type: string iconId: type: string 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 items: $ref: '#/components/schemas/NotificationTemplate' 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 radioId: type: string description: Radio identifier minLength: 0 maxLength: 20 rangeMax: type: string rangeMin: type: string description: Updating sensor type properties SensorCopyOverrides: type: object properties: sensorOverrides: description: Sensor properties to override on the copy. $ref: '#/components/schemas/ExternalSensorEditable' sensorTypeOverrides: description: Sensor type properties to override on the copy. $ref: '#/components/schemas/SensorTypeUpdate' 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 ImportCheck: type: object required: - name - notificationIds - notificationRelevance - notifications - sensorType - timezone properties: calculationSettings: description: The calculation settings if this is a calculation data source. $ref: '#/components/schemas/CalculationSettings' decimalsPerField: type: object description: The number of decimals used for each field of the data source. additionalProperties: type: integer format: int32 description: type: string description: Brief description that elaborates on the name enabled: type: boolean description: Whether the data source is enabled. ingestedForIndices: type: object description: The data source's indexes for ingested values additionalProperties: type: array items: type: string integrationType: type: string description: Integration type. locationId: type: string description: Identifier of the site it belongs to, together with the organizationId this is unique. name: type: string description: Displayable name. notificationRelevance: type: integer format: int32 description: The notification relevance for import check hits. minimum: 300 rangePerJsonKey: type: object description: Min/max ranges for each json key of the data source. additionalProperties: type: array items: type: number format: double sensorType: type: string description: The sensor type. sourceId: type: string description: Optional source id. status: type: string description: The status of the data source, e.g. ACTIVE, DEACTIVATED or PAUSED. enum: - ACTIVE - DEACTIVATED - PAUSED tags: type: array description: The tags associated with the data source. uniqueItems: true items: type: string timezone: type: string description: An area which observes a uniform standard time. unitPerField: type: object description: Identifier of the preferred unit conversion for each field. additionalProperties: type: string useCollectionsAsRows: type: boolean description: Whether collections should be displayed as rows. zoneId: type: string description: Identifier of the zone within a site where the data source belongs. createdAt: type: string description: Timestamp of when it was created. cultivationHierarchyId: type: string description: 'Cultivation composite identifier of format: ###' dataSourceCoordinateHistory: type: array items: $ref: '#/components/schemas/DataSourceCoordinates' dataSourceCoordinates: $ref: '#/components/schemas/DataSourceCoordinates' notificationIds: type: array description: Ids of the notifications for this check items: type: string notifications: type: array description: The notifications set for this sensor. items: $ref: '#/components/schemas/Notification' organizationId: type: string description: Identifier of the organization this data source belongs to. state: type: string description: 'The current state of the data source: UP or DOWN.' checkId: type: string description: Identifier of the data source collections: type: array description: Optional collections within data source data items: $ref: '#/components/schemas/CheckCollection' hasNotifications: type: boolean description: Does the data source have any notifications associated with it maxDecimals: type: integer format: int32 description: Max decimals for fields of the data source. siteId: type: string description: Identifier of the site it belongs to, together with the organizationId this is unique. description: Import check properties securitySchemes: Bearer: description: '' type: apiKey name: Authorization in: header