openapi: 3.2.0 info: version: '2.0' title: ZENSIE Shared Check API servers: - url: https://api.30mhz.com/api tags: - name: shared-check paths: /shared-check: post: tags: - shared-check summary: Share one or more checks with one or more users or with a group description: Only admins and organization owners/editors can share checks. operationId: createSharedCheck security: - Bearer: [] responses: '200': description: Check(s) shared successfully content: application/json: schema: type: array items: $ref: '#/components/schemas/SharedCheck' application/zensie-v2+json: schema: type: array items: $ref: '#/components/schemas/SharedCheck' '400': description: 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/NewSharedCheck' /shared-check/{sharedCheckId}: get: tags: - shared-check summary: Gets a specific shared check description: Admins and shared-with user can get a specific shared check operationId: getSharedCheck parameters: - name: sharedCheckId in: path required: true schema: type: string security: - Bearer: [] responses: '200': description: Shared check returned '403': description: Unauthorized to get this shared check '500': description: Server error while getting shared check delete: tags: - shared-check summary: Deletes a specific shared check description: Admins, owners and editors can delete a specific shared check operationId: deleteSharedCheck parameters: - name: sharedCheckId in: path required: true schema: type: string security: - Bearer: [] responses: '204': description: Shared check deleted '403': description: Unauthorized to delete this shared check '500': description: Server error while deleting shared check /shared-check/from/organization/{organizationId}: get: tags: - shared-check summary: Returns all the checks for the given organization that have been shared description: Only admin users and organization members have permission to get this list of checks. operationId: getChecksFromOrganizationThatHaveBeenShared parameters: - name: organizationId in: path required: true schema: type: string security: - Bearer: [] responses: '200': description: List of checks in the organization that have been shared content: application/json: schema: type: array items: $ref: '#/components/schemas/SharedCheck' application/zensie-v2+json: schema: type: array items: $ref: '#/components/schemas/SharedCheck' '403': description: Not enough permissions to perform the operation /shared-check/by/{by}: get: tags: - shared-check summary: Returns all the checks shared by the given user description: An admin user will see all checks shared by the requested user; a non-admin user can only request to see checks shared by themselves. operationId: getChecksSharedByUser parameters: - name: by in: path required: true schema: type: string security: - Bearer: [] responses: '200': description: List of checks shared by the given user. content: application/json: schema: type: array items: $ref: '#/components/schemas/SharedCheck' application/zensie-v2+json: schema: type: array items: $ref: '#/components/schemas/SharedCheck' '400': description: Not a valid e-mail address. '403': description: Not enough permissions to perform the operation. /shared-check/with/{with}: get: tags: - shared-check summary: Returns all the checks shared with the requested user by the current user description: An admin user will see all checks shared with the requested user; a non-admin user can only request to see checks shared with themselves. operationId: getChecksSharedWithUser parameters: - name: with in: path required: true schema: type: string security: - Bearer: [] responses: '200': description: List of checks shared with the given user. content: application/json: schema: type: array items: $ref: '#/components/schemas/SharedCheck' application/zensie-v2+json: schema: type: array items: $ref: '#/components/schemas/SharedCheck' '400': description: Not a valid e-mail address. '403': description: Not enough permissions to perform the operation /shared-check/check/{checkId}: get: tags: - shared-check summary: Returns the details (shared by who, shared with who etc) of a check that has… description: An admin user can see details of all checks; non-admin users see can details of checks from within their organisation. operationId: listSharedCheckDetails parameters: - name: checkId in: path required: true schema: type: string security: - Bearer: [] responses: '200': description: Share details for a given check. content: application/json: schema: type: array items: $ref: '#/components/schemas/SharedCheck' application/zensie-v2+json: schema: type: array items: $ref: '#/components/schemas/SharedCheck' '400': description: Not a valid e-mail address. '403': description: Not enough permissions to perform the operation delete: tags: - shared-check summary: Turn sharing off for a check description: Admins,owners and editors can stop sharing a check operationId: turnSharingOff parameters: - name: checkId in: path required: true schema: type: string security: - Bearer: [] responses: '204': description: Sharing turned off for this check '403': description: Unauthorized to turn sharing off for this check '500': description: Server error while turning off sharing for this check /shared-check/with-group/{groupId}: get: tags: - shared-check summary: Get the sensors belonging a group description: '' operationId: viewSensors parameters: - name: groupId in: path required: true schema: type: string security: - Bearer: [] responses: '200': description: List of sensors content: application/json: schema: $ref: '#/components/schemas/SharedCheck' application/zensie-v2+json: schema: $ref: '#/components/schemas/SharedCheck' '403': description: User is not authorized to perform this operation, user must be admin or belong to the group '500': description: Sorry, there was a problem retrieving the sensors. components: schemas: SharedCheck: type: object properties: checkId: type: string description: Id of the original check that is being shared checkSummary: description: The underlying check that is shared $ref: '#/components/schemas/CheckSummary' createdAt: type: string description: The date and time a check was shared. It can be blank for older shared checks organizationId: type: string description: ID of the organization to which the shared check belongs organizationName: type: string description: Name of the organization to which the shared check belongs shareEndDate: type: string description: Until when can sensor data be viewed shareStartDate: type: string description: Starting from when can sensor data be viewed sharedByUser: type: string description: User who shared the check sharedByUserDetails: $ref: '#/components/schemas/SharedByUserDetails' sharedCheckId: type: string description: Id of the shared-check itself sharedWithGroup: type: string description: Group which the check has been shared with sharedWithGroupDetails: $ref: '#/components/schemas/SharedWithGroupDetails' sharedWithUser: type: string description: User who the check has been shared with sharedWithUserDetails: $ref: '#/components/schemas/SharedWithUserDetails' 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. SharedWithGroupDetails: type: object properties: error: type: string title: type: string SharedByUserDetails: type: object properties: firstName: type: string lastName: type: string SharedWithUserDetails: type: object properties: firstName: type: string lastName: 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 NewSharedCheck: type: object properties: checkIds: type: array uniqueItems: true items: type: string shareEndDate: type: string shareStartDate: type: string shareWith: type: array uniqueItems: true items: type: string shareWithGroups: type: array uniqueItems: true items: type: string securitySchemes: Bearer: description: '' type: apiKey name: Authorization in: header