openapi: 3.2.0 info: version: '2.0' title: ZENSIE App Cultiwatch API servers: - url: https://api.30mhz.com/api tags: - name: app-cultiwatch paths: /app/cultiwatch/drop: post: tags: - app-cultiwatch summary: Returns the drop calculation description: The authenticated user must have the cultiwatch app within an organization operationId: getDrop parameters: - name: intervalSize in: query description: Size of the time intervals in which to aggregate the data. This parameter is given as a number of minutes, hours, days or weeks, or monthly, e.g. '5m' is five minutes, '1h' is one hour, '5d' is five days, '2w' is two weeks and 'M' is monthly. The optional 'f' prefix is used to retrieve the full interval according to the provided unit, e.g. 'f1w' will retrieve the last full week (Mon to Sun), 'f2d' will retrieve the last two full days (Wed and Thu if it is Fri). required: false schema: type: string - name: timezoneOffset in: query description: 'The timezone offset, in hours, for which to return the data. For example, 2 for Europe/Amsterdam. -3 for America/Argentina/Buenos_Aires. If empty, then UTC/GMT time is assumed, but it''s probably not what you want. See list of timezones: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones' required: false schema: type: integer format: int32 - name: irrigationStartHour in: query description: Irrigation start time in hours (e.g. '8' if it starts at 8 in the morning) required: true schema: type: integer format: int32 - name: irrigationPeriodMargin in: query description: Margin that is added to irrigation start and end period in hours. Default is 2 hours required: false schema: type: integer format: int32 - name: irrigationFrequency in: query description: Maximum period between watering cycles during irrigation in seconds. Default is 7200 (2 hours) required: false schema: type: integer format: int32 - name: minIrrigationSlope in: query description: To find out when irrigation starts and stops we calculate the derivative. What should the minimum slope be? (default 0) required: false schema: type: number format: double security: - Bearer: [] responses: '200': description: Returns the drop calculation content: application/json: schema: $ref: '#/components/schemas/DropResponse' application/zensie-v2+json: schema: $ref: '#/components/schemas/DropResponse' '403': description: Unauthorized to perform the operation. User must have access to cultiwatch app or be an admin. requestBody: content: application/json: schema: $ref: '#/components/schemas/CheckStatsRequest' /app/cultiwatch/drop/interval/{interval}: post: tags: - app-cultiwatch summary: Returns multiple drop calculation by interval description: The authenticated user must have the cultiwatch app within an organization operationId: getDropByInterval parameters: - name: interval in: path description: 'Intervals allowed : c, today, (f)1h, (f)2h, ..., (f)xh, (f)1d, (f)2d, ..., (f)xd, (f)1w, (f)2w, ..., (f)xw, (f)1M, (f)2M, ..., (f)xM. ' required: true schema: type: string - name: intervalSize in: query description: Size of the time intervals in which to aggregate the data. This parameter is given as a number of minutes, hours, days or weeks, or monthly, e.g. '5m' is five minutes, '1h' is one hour, '5d' is five days, '2w' is two weeks and 'M' is monthly. The optional 'f' prefix is used to retrieve the full interval according to the provided unit, e.g. 'f1w' will retrieve the last full week (Mon to Sun), 'f2d' will retrieve the last two full days (Wed and Thu if it is Fri). required: false schema: type: string - name: timezoneOffset in: query description: 'The timezone offset, in hours, for which to return the data. For example, 2 for Europe/Amsterdam. -3 for America/Argentina/Buenos_Aires. If empty, then UTC/GMT time is assumed, but it''s probably not what you want. See list of timezones: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones' required: false schema: type: integer format: int32 - name: irrigationStartHour in: query description: Irrigation start time in hours (e.g. '8' if it starts at 8 in the morning) required: true schema: type: integer format: int32 - name: irrigationPeriodMargin in: query description: Margin that is added to irrigation start and end period in hours. Default is 2 hours required: false schema: type: integer format: int32 - name: irrigationFrequency in: query description: Maximum period between watering cycles during irrigation in seconds. Default is 7200 (2 hours) required: false schema: type: integer format: int32 - name: minIrrigationSlope in: query description: To find out when irrigation starts and stops we calculate the derivative. What should the minimum slope be? (default 0) required: false schema: type: number format: double security: - Bearer: [] responses: '200': description: Returns the drop calculations by interval content: application/json: schema: $ref: '#/components/schemas/DropResponse' application/zensie-v2+json: schema: $ref: '#/components/schemas/DropResponse' '403': description: Unauthorized to perform the operation. User must have access to cultiwatch app or be an admin. requestBody: content: application/json: schema: $ref: '#/components/schemas/CheckStatsRequest' components: schemas: CheckStatsRequest: type: object properties: checkIds: type: array description: Check ids for returning the historical data. uniqueItems: true items: type: string collectionIdsPerField: type: object description: Filter/group values based on fields and collection ids additionalProperties: type: array uniqueItems: true items: type: string daysOfMonth: type: array description: Day (1-31) list parameter, e.g. [1] for the first of the month. items: type: integer format: int32 daysOfWeek: type: array description: Day of the week (1-7) list parameter, e.g. [1] for Monday. items: type: integer format: int32 hoursOfDay: type: array description: Hour (0-23) list parameter, e.g. [2, 3] for 2:00 am and 3:00 am. items: type: integer format: int32 minutesOfHour: type: array description: Minute within the hour (0-59) list parameter, e.g. [20, 30] for 20th and 30th minute. items: type: integer format: int32 organizationId: type: string description: The id of an organization (when tags are set). sensorType: type: string description: The id of a sensor type (when tags are set). tags: type: array description: Set tags to automatically select checks based on their tags. uniqueItems: true items: type: string tagsOperator: type: string description: Tags boolean operator (and/or). DropResponse: type: object properties: averageIrrigiationValue: type: number format: double drop: type: number format: double endDate: type: integer format: int64 irrigationStartTimestamp: type: integer format: int64 irrigationStartValue: type: number format: double irrigationStopTimestamp: type: integer format: int64 irrigationStopValue: type: number format: double startDate: type: integer format: int64 securitySchemes: Bearer: description: '' type: apiKey name: Authorization in: header