openapi: 3.2.0 info: version: '2.0' title: ZENSIE Widget API servers: - url: https://api.30mhz.com/api tags: - name: Widget paths: /widget/dashboard/{dashboardId}: get: tags: - Widget summary: Return all the widgets of the given dashboard description: Only organization members or administrators of ZENSIE are authorised to call this operation. operationId: listWidgets parameters: - name: dashboardId in: path required: true schema: type: string - name: widgetId in: query description: The widget id required: false schema: type: string security: - Bearer: [] responses: '200': description: List of dashboard widgets returned content: application/json: schema: type: array items: $ref: '#/components/schemas/Widget' application/zensie-v2+json: schema: type: array items: $ref: '#/components/schemas/Widget' '403': description: User not allowed to make this call post: tags: - Widget summary: Create one or more widgets in the dashboard given description: Organization owners, editors and administrators of ZENSIE are authorised to call this operation. operationId: createWidgets parameters: - name: dashboardId in: path required: true schema: type: string security: - Bearer: [] responses: '201': description: New widgets created content: application/json: schema: type: array items: $ref: '#/components/schemas/Widget' application/zensie-v2+json: schema: type: array items: $ref: '#/components/schemas/Widget' '403': description: User not allowed to perform the operation requestBody: content: application/json: schema: type: array items: $ref: '#/components/schemas/NewWidget' /widget/{widgetId}: get: tags: - Widget summary: Retrieve a widget description: '' operationId: getWidget parameters: - name: widgetId in: path required: true schema: type: string security: - Bearer: [] responses: '200': description: The widget content: application/json: schema: $ref: '#/components/schemas/Widget' application/zensie-v2+json: schema: $ref: '#/components/schemas/Widget' '403': description: User not allowed to make this call delete: tags: - Widget summary: Delete a widget from its dashboard description: Organization owners, editors and administrators of ZENSIE are authorised to call this operation. operationId: deleteWidget parameters: - name: widgetId in: path required: true schema: type: string security: - Bearer: [] responses: '200': description: Widget deleted '403': description: User not allowed to perform the operation /widget/clone/{widgetId}: post: tags: - Widget summary: Clones the widget to an optional target dashboard. description: '' operationId: cloneWidgetInDashboard parameters: - name: widgetId in: path description: ID of the widget to clone. required: true schema: type: string - name: targetDashboardId in: query description: ID of the target dashboard where to clone the widget. required: false schema: type: string security: - Bearer: [] responses: '201': description: Cloned widget created content: application/json: schema: $ref: '#/components/schemas/Widget' application/zensie-v2+json: schema: $ref: '#/components/schemas/Widget' '403': description: Not enough permissions to perform the operation '404': description: Some object was not found /widget/organization/{organizationId}: post: tags: - Widget summary: Create one or more widgets in the given organization description: '' operationId: createOrganizationWidgets parameters: - name: organizationId in: path required: true schema: type: string security: - Bearer: [] responses: '201': description: New widgets created content: application/json: schema: type: array items: $ref: '#/components/schemas/Widget' application/zensie-v2+json: schema: type: array items: $ref: '#/components/schemas/Widget' '403': description: User not allowed to perform the operation requestBody: content: application/json: schema: type: array items: $ref: '#/components/schemas/NewWidget' components: schemas: 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. ImageDimensions: type: object properties: height: type: integer format: int32 width: type: integer format: int32 Widget: type: object properties: derivative: type: boolean description: Whether the data of this widget represents the rate of change. appId: type: string chartConfiguration: $ref: '#/components/schemas/ChartConfiguration' chartVerticalAxes: type: array items: $ref: '#/components/schemas/ChartAxis' checks: type: array items: $ref: '#/components/schemas/CheckSummary' childWidgets: type: array items: $ref: '#/components/schemas/Widget' collectionIdsPerField: type: object additionalProperties: type: array items: type: string comments: type: array items: $ref: '#/components/schemas/Comment' cultivationId: type: string cultivationTargetId: type: string cumulative: type: boolean dashboardId: type: string data: $ref: '#/components/schemas/Data' dataSourcePerCultivation: type: object description: Map of data sources selected per cultivation additionalProperties: type: array items: type: string fields: type: object additionalProperties: type: array items: type: string interval: type: string intervalFrom: type: string intervalSize: type: string intervalTo: type: string metricUnits: type: object additionalProperties: type: string order: type: integer format: int32 description: Position order in a dashboard, starts from 1 organizationId: type: string parentWidgetId: type: string partOfDay: type: string description: The part of the day the widget displays data for. scope: $ref: '#/components/schemas/Scope' showSunEvents: type: boolean siteId: type: string statisticType: type: string subtitle: type: string title: type: string widgetId: type: string widgetType: type: string imageDimensions: $ref: '#/components/schemas/ImageDimensions' description: A dashboard widget Comment: type: object properties: activityType: type: string appInstallationId: type: string email: type: string groupId: type: string lastUpdatedTimestamp: type: string organizationId: type: string timestamp: type: string attachments: description: Comment Attachments $ref: '#/components/schemas/CommentAttachments' commentId: type: string description: Unique id of the comment. parentCommentId: type: string description: Parent comment id if reply replies: type: array description: Replies of a comment items: $ref: '#/components/schemas/Comment' tags: description: Tags of a comment $ref: '#/components/schemas/CommentTags' text: type: string description: Comment text CommentAttachments: type: object properties: documents: type: array uniqueItems: true items: $ref: '#/components/schemas/AttachedDocument' images: type: array uniqueItems: true items: $ref: '#/components/schemas/ImageWithThumbnails' ImageWithThumbnails: type: object properties: dataUploadId: type: string imageDimensions: $ref: '#/components/schemas/ImageDimensions' thumbnails: type: array items: $ref: '#/components/schemas/ImageThumbnail' url: type: string ImageThumbnail: type: object properties: height: type: integer format: int32 path: type: string url: type: string width: type: integer format: int32 ChartAxis: type: object properties: axisPosition: type: string description: The position of the axis (e.g. left side) enum: - LEFT - RIGHT - HIDDEN maxRange: type: number format: double description: Maximum value of the range minRange: type: number format: double description: Minimum value of the range name: type: string description: Name of the axis CommentTags: type: object properties: fields: type: object description: Check fields additionalProperties: type: array uniqueItems: true items: type: string checkIds: type: array description: Check ids to which comment belongs to uniqueItems: true items: type: string checkTimestamp: type: integer format: int64 description: Timestamp of the check collectionId: type: string description: Collection id within a check dateEntryId: type: string description: Date entry id of a check emails: type: array description: Users mentioned in the comments uniqueItems: true items: type: string selectedCheckId: type: string description: Selected check for this comment selectedField: type: string description: Selected field id for this comment Scope: type: object properties: aggregated: type: boolean checkIds: type: array items: type: string notificationIds: type: array items: type: string sensorType: type: string tags: type: array items: type: string tagsOperator: 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 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 AttachedDocument: type: object properties: dataUploadId: type: string filename: type: string url: type: string Data: type: object properties: content: type: string position: type: object additionalProperties: type: number format: double config: type: object additionalProperties: type: object dataUploadId: type: string imageDimensions: $ref: '#/components/schemas/ImageDimensions' NewWidget: type: object properties: appId: type: string chartConfiguration: $ref: '#/components/schemas/ChartConfiguration' chartVerticalAxes: type: array items: $ref: '#/components/schemas/ChartAxis' collectionIdsPerField: type: object additionalProperties: type: array items: type: string cultivationId: type: string cultivationTargetId: type: string cumulative: type: boolean data: $ref: '#/components/schemas/Data' dataSourcePerCultivation: type: object additionalProperties: type: array items: type: string derivative: type: boolean fields: type: object additionalProperties: type: array items: type: string interval: type: string intervalFrom: type: string intervalSize: type: string intervalTo: type: string metricUnits: type: object additionalProperties: type: string parentWidgetId: type: string partOfDay: type: string scope: $ref: '#/components/schemas/Scope' showSunEvents: type: boolean statisticType: type: string subtitle: type: string title: type: string widgetType: type: string ChartConfiguration: type: object properties: chartType: type: string description: Type of chart visualisation (line or bar). enum: - LINE - BAR colorPerSensorField: type: object description: Color per data series of this widget additionalProperties: type: string colorScheme: type: string description: Color scheme of the chart. enum: - PER_METRIC - CUSTOM - DISTINCT isStacked: type: boolean description: Whether the chart's graph elements (lines or bars) are shown one on top of the other. showWeekNumbers: type: boolean description: Whether to show week numbers in the chart securitySchemes: Bearer: description: '' type: apiKey name: Authorization in: header