openapi: 3.0.1 info: title: IO.Common Accounts Devices API version: '1.0' security: - OAuth2: [] tags: - name: Devices paths: /v1/Devices/commands: get: tags: - Devices summary: Returns list of available device commands operationId: Device commands parameters: - name: Account in: query description: Account schema: title: Account type: int responses: '200': description: Success content: application/json: schema: type: array items: type: string '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ApiErrorResponse' '401': description: Unauthorized '403': description: Forbidden security: - OAuth2: - io.common /v1/Devices: get: tags: - Devices summary: Returns list of devices for the tenant operationId: Devices list parameters: - name: status in: query description: '' schema: type: string - name: Filter in: query schema: type: string - name: Page in: query schema: type: integer format: int32 - name: PageSize in: query schema: type: integer format: int32 - name: SortColumn in: query schema: type: string - name: SortOrder in: query schema: type: string - name: Account in: query description: Account schema: title: Account type: int responses: '200': description: Success content: application/json: schema: $ref: '#/components/schemas/DeviceResponseIPagedResult' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ApiErrorResponse' '401': description: Unauthorized '403': description: Forbidden security: - OAuth2: - io.common /v1/Devices/{deviceId}: get: tags: - Devices summary: Returns device details operationId: Device details parameters: - name: deviceId in: path description: '' required: true schema: type: string format: uuid - name: Account in: query description: Account schema: title: Account type: int responses: '200': description: Success content: application/json: schema: $ref: '#/components/schemas/DeviceResponse' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ApiErrorResponse' '401': description: Unauthorized '403': description: Forbidden security: - OAuth2: - io.common put: tags: - Devices summary: Update tenant device information operationId: Update tenant device information parameters: - name: deviceId in: path description: '' required: true schema: type: string format: uuid - name: Account in: query description: Account schema: title: Account type: int requestBody: description: '' content: application/json-patch+json; x-api-version=1.0: schema: $ref: '#/components/schemas/DeviceUpdateRequest' application/json; x-api-version=1.0: schema: $ref: '#/components/schemas/DeviceUpdateRequest' text/json; x-api-version=1.0: schema: $ref: '#/components/schemas/DeviceUpdateRequest' application/*+json; x-api-version=1.0: schema: $ref: '#/components/schemas/DeviceUpdateRequest' responses: '200': description: Success content: application/json: schema: $ref: '#/components/schemas/DeviceResponse' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ApiErrorResponse' '401': description: Unauthorized '403': description: Forbidden security: - OAuth2: - io.common delete: tags: - Devices summary: Delete tenant device operationId: Delete tenant device parameters: - name: deviceId in: path description: '' required: true schema: type: string format: uuid - name: Account in: query description: Account schema: title: Account type: int responses: '200': description: Success content: application/json: schema: $ref: '#/components/schemas/DeviceResponse' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ApiErrorResponse' '401': description: Unauthorized '403': description: Forbidden security: - OAuth2: - io.common /v1/Devices/{deviceId}/command: post: tags: - Devices summary: Send FireBase command to the device operationId: Send command to the device parameters: - name: deviceId in: path description: '' required: true schema: type: string format: uuid - name: Account in: query description: Account schema: title: Account type: int requestBody: description: '' content: application/json-patch+json; x-api-version=1.0: schema: $ref: '#/components/schemas/SendDeviceCommandRequest' application/json; x-api-version=1.0: schema: $ref: '#/components/schemas/SendDeviceCommandRequest' text/json; x-api-version=1.0: schema: $ref: '#/components/schemas/SendDeviceCommandRequest' application/*+json; x-api-version=1.0: schema: $ref: '#/components/schemas/SendDeviceCommandRequest' responses: '204': description: No Content '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ApiErrorResponse' '401': description: Unauthorized '403': description: Forbidden security: - OAuth2: - io.common /v1/Devices/locations/{locationId}/sync_users: post: tags: - Devices summary: Notifies all devices in the location to sync users operationId: Sync location users in related devices parameters: - name: locationId in: path description: '' required: true schema: type: integer format: int32 - name: Account in: query description: Account schema: title: Account type: int responses: '204': description: No Content '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ApiErrorResponse' '422': description: Client Error content: application/json: schema: $ref: '#/components/schemas/ApiErrorResponse' '401': description: Unauthorized '403': description: Forbidden security: - OAuth2: - io.common /v1/Devices/{deviceId}/heartbeats: get: tags: - Devices summary: Returns list of device heartbeats operationId: Device heartbeats list parameters: - name: deviceId in: path description: '' required: true schema: type: string format: uuid - name: Filter in: query schema: type: string - name: Page in: query schema: type: integer format: int32 - name: PageSize in: query schema: type: integer format: int32 - name: SortColumn in: query schema: type: string - name: SortOrder in: query schema: type: string - name: Account in: query description: Account schema: title: Account type: int responses: '200': description: Success content: application/json: schema: type: array items: $ref: '#/components/schemas/DeviceHeartbeatResponse' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ApiErrorResponse' '401': description: Unauthorized '403': description: Forbidden security: - OAuth2: - io.common /v1/Devices/{deviceId}/events: get: tags: - Devices summary: Returns list of device events operationId: Device events list parameters: - name: deviceId in: path description: '' required: true schema: type: string format: uuid - name: Filter in: query schema: type: string - name: Page in: query schema: type: integer format: int32 - name: PageSize in: query schema: type: integer format: int32 - name: SortColumn in: query schema: type: string - name: SortOrder in: query schema: type: string - name: Account in: query description: Account schema: title: Account type: int responses: '200': description: Success content: application/json: schema: type: array items: $ref: '#/components/schemas/DeviceEventsResponse' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ApiErrorResponse' '401': description: Unauthorized '403': description: Forbidden security: - OAuth2: - io.common /v1/Devices/dedicated/register/pre: post: tags: - Devices summary: Pre register tenant dedicated device parameters: - name: Account in: query description: Account schema: title: Account type: int requestBody: description: DedicatedDevicePreRegistrationRequest content: application/json-patch+json; x-api-version=1.0: schema: $ref: '#/components/schemas/DedicatedDevicePreRegistrationRequest' application/json; x-api-version=1.0: schema: $ref: '#/components/schemas/DedicatedDevicePreRegistrationRequest' text/json; x-api-version=1.0: schema: $ref: '#/components/schemas/DedicatedDevicePreRegistrationRequest' application/*+json; x-api-version=1.0: schema: $ref: '#/components/schemas/DedicatedDevicePreRegistrationRequest' responses: '201': description: Created content: application/json: schema: $ref: '#/components/schemas/DedicatedDevicePreRegistrationResponse' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ApiErrorResponse' '401': description: Unauthorized '403': description: Forbidden security: - OAuth2: - io.common /v1/Devices/{deviceId}/regen: post: tags: - Devices summary: Authorise dedicated device to aquire new secret parameters: - name: deviceId in: path description: '' required: true schema: type: string format: uuid - name: Account in: query description: Account schema: title: Account type: int responses: '200': description: Success '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ApiErrorResponse' '401': description: Unauthorized '403': description: Forbidden security: - OAuth2: - io.common /v1/Devices/free-cabinets: get: tags: - Devices summary: Returns list of free cabinets for the tenant, optionally filtered by cabinet type operationId: Free cabinets list parameters: - name: tenantId in: query description: '' schema: type: string format: uuid - name: cabinetType in: query description: '' schema: $ref: '#/components/schemas/CabinetType' - name: Account in: query description: Account schema: title: Account type: int responses: '200': description: Success content: application/json: schema: type: array items: $ref: '#/components/schemas/ProvisioningCabinetResponse' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ApiErrorResponse' '401': description: Unauthorized '403': description: Forbidden security: - OAuth2: - io.common components: schemas: IDomainEvent: type: object properties: id: type: string format: uuid readOnly: true occurredOn: type: string format: date-time readOnly: true additionalProperties: false DeviceEvent: type: object properties: deviceId: type: string format: uuid readOnly: true name: type: string nullable: true readOnly: true content: type: string nullable: true readOnly: true received: type: string format: date-time readOnly: true domainEvents: type: array items: $ref: '#/components/schemas/IDomainEvent' nullable: true readOnly: true additionalProperties: false DeviceHeartbeatUserinfoResponse: type: object properties: heartbeatId: type: integer format: int32 unfinishedScans: type: integer format: int32 unfinishedSessions: type: integer format: int32 unsentSessions: type: integer format: int32 unsentScans: type: integer format: int32 username: type: string nullable: true additionalProperties: false DeviceEventNotification: type: object properties: id: type: integer format: int32 deviceId: type: string format: uuid eventName: type: string nullable: true eventContent: type: string nullable: true receivers: type: array items: $ref: '#/components/schemas/NotificationsReceiver' nullable: true readOnly: true additionalProperties: false TenantDevice: type: object properties: tenantId: type: string format: uuid deviceId: type: string format: uuid device: $ref: '#/components/schemas/Device' additionalProperties: false DeviceSIMStatus: type: object properties: id: type: integer format: int32 readOnly: true domainEvents: type: array items: $ref: '#/components/schemas/IDomainEvent' nullable: true readOnly: true iccid: maxLength: 21 minLength: 0 type: string nullable: true dataLimit: type: number format: double dataUsage: type: number format: double statusDate: type: string format: date-time additionalProperties: false Device: type: object properties: id: type: string format: uuid readOnly: true domainEvents: type: array items: $ref: '#/components/schemas/IDomainEvent' nullable: true readOnly: true createdOn: type: string format: date-time nullable: true readOnly: true modifiedOn: type: string format: date-time nullable: true readOnly: true name: type: string nullable: true readOnly: true token: type: string nullable: true readOnly: true iccid: type: string nullable: true readOnly: true dedicatedDeviceId: type: string format: uuid nullable: true readOnly: true sbNumber: type: string nullable: true readOnly: true ioid: type: string nullable: true readOnly: true externalId: type: string nullable: true readOnly: true isDeleted: type: boolean readOnly: true type: $ref: '#/components/schemas/DeviceType' deletedOn: type: string format: date-time nullable: true readOnly: true deviceTenants: type: array items: $ref: '#/components/schemas/TenantDevice' nullable: true readOnly: true deviceEvents: type: array items: $ref: '#/components/schemas/DeviceEvent' nullable: true readOnly: true deviceHeartbeats: type: array items: $ref: '#/components/schemas/DeviceHeartbeat' nullable: true readOnly: true deviceEventNotifications: type: array items: $ref: '#/components/schemas/DeviceEventNotification' nullable: true readOnly: true deviceRegistrationStates: type: array items: $ref: '#/components/schemas/DeviceRegistrationState' nullable: true readOnly: true deviceSIMStatuses: type: array items: $ref: '#/components/schemas/DeviceSIMStatus' nullable: true readOnly: true deviceShelfStatuses: type: array items: $ref: '#/components/schemas/DeviceShelfStatus' nullable: true readOnly: true cabinetProdData: $ref: '#/components/schemas/CabinetProdData' currentRegistrationState: $ref: '#/components/schemas/DeviceRegistrationState' additionalProperties: false DeviceRegistrationState: type: object properties: id: type: integer format: int32 readOnly: true domainEvents: type: array items: $ref: '#/components/schemas/IDomainEvent' nullable: true readOnly: true createdOn: type: string format: date-time nullable: true readOnly: true modifiedOn: type: string format: date-time nullable: true readOnly: true deviceId: type: string format: uuid pairingCode: type: string nullable: true state: $ref: '#/components/schemas/DevicePreRegistrationStatus' tenantId: type: string format: uuid nullable: true deviceName: type: string nullable: true additionalProperties: false CabinetProdData: type: object properties: id: type: integer format: int32 readOnly: true domainEvents: type: array items: $ref: '#/components/schemas/IDomainEvent' nullable: true readOnly: true deviceId: type: string format: uuid batchNumber: type: string nullable: true readOnly: true verdinSN: type: string nullable: true readOnly: true cabinetType: $ref: '#/components/schemas/CabinetType' comment: type: string nullable: true readOnly: true region: type: string nullable: true readOnly: true additionalProperties: false DeviceShelfStatus: type: object properties: id: type: integer format: int32 readOnly: true domainEvents: type: array items: $ref: '#/components/schemas/IDomainEvent' nullable: true readOnly: true deviceId: type: string format: uuid spineHWVer: type: string nullable: true shelfHWVer: type: string nullable: true pcbhwVer: type: string nullable: true compartment: type: integer format: int32 slot: type: integer format: int32 binCount: type: integer format: int32 statusDate: type: string format: date-time additionalProperties: false SendDeviceCommandRequest: type: object properties: command: type: string nullable: true additionalProperties: false Error: type: object properties: code: type: string nullable: true message: type: string nullable: true additionalProperties: false CabinetType: enum: - 0 - 1 type: integer format: int32 DedicatedDevicePreRegistrationRequest: required: - deviceName type: object properties: deviceName: minLength: 1 type: string additionalProperties: false DeviceHeartbeat: type: object properties: id: type: integer format: int32 readOnly: true domainEvents: type: array items: $ref: '#/components/schemas/IDomainEvent' nullable: true readOnly: true deviceId: type: string format: uuid osVersion: type: string nullable: true appVersion: type: string nullable: true batteryPercentage: type: integer format: int32 batteryCurrentNow: type: integer format: int32 batteryCurrentAverage: type: integer format: int32 batteryVoltage: type: integer format: int32 batteryStatus: type: string nullable: true unsentSessions: type: integer format: int32 unfinishedSessions: type: integer format: int32 received: type: string format: date-time device: $ref: '#/components/schemas/Device' ioid: type: string nullable: true userInfo: type: array items: $ref: '#/components/schemas/DeviceHeartbeatUserInfo' nullable: true readOnly: true linkedDevices: type: array items: type: string nullable: true additionalProperties: false DeviceType: enum: - 0 - 1 - 2 - 3 - 4 type: integer format: int32 DeviceHeartbeatUserInfo: type: object properties: id: type: integer format: int32 readOnly: true domainEvents: type: array items: $ref: '#/components/schemas/IDomainEvent' nullable: true readOnly: true heartbeatId: type: integer format: int32 unfinishedScans: type: integer format: int32 unfinishedSessions: type: integer format: int32 unsentSessions: type: integer format: int32 unsentScans: type: integer format: int32 username: type: string nullable: true deviceHeartbeat: $ref: '#/components/schemas/DeviceHeartbeat' additionalProperties: false DedicatedDevicePreRegistrationResponse: type: object properties: deviceId: type: string format: uuid deviceName: type: string nullable: true pairingCode: type: string nullable: true serialNumber: type: string nullable: true readOnly: true deprecated: true additionalProperties: false DeviceResponseIPagedResult: type: object properties: pageSize: type: integer format: int32 readOnly: true page: type: integer format: int32 readOnly: true totalCount: type: integer format: int32 readOnly: true filteredCount: type: integer format: int32 readOnly: true data: type: array items: $ref: '#/components/schemas/DeviceResponse' nullable: true readOnly: true additionalProperties: false DeviceEventsResponse: type: object properties: deviceId: type: string format: uuid name: type: string nullable: true content: type: string nullable: true received: type: string format: date-time additionalProperties: false ProvisioningCabinetResponse: type: object properties: deviceId: type: string format: uuid customerTenantId: type: string format: uuid nullable: true customerTenantName: type: string nullable: true sbNumber: type: string nullable: true deviceName: type: string nullable: true state: type: integer format: int32 nullable: true verdinSN: type: string nullable: true cabinetType: $ref: '#/components/schemas/CabinetType' comment: type: string nullable: true region: type: string nullable: true additionalProperties: false DeviceUpdateRequest: type: object properties: name: type: string nullable: true token: type: string nullable: true additionalProperties: false DevicePreRegistrationStatus: enum: - 0 - 1 - 2 - 3 - 4 type: integer format: int32 DeviceResponse: type: object properties: id: type: string format: uuid name: type: string nullable: true ioid: type: string nullable: true type: $ref: '#/components/schemas/DeviceType' token: type: string nullable: true osVersion: type: string nullable: true appVersion: type: string nullable: true received: type: string format: date-time nullable: true batteryPercentage: type: integer format: int32 nullable: true batteryStatus: type: string nullable: true unsentSessions: type: integer format: int32 nullable: true unfinishedSessions: type: integer format: int32 nullable: true status: type: string nullable: true lastSeenSecAgo: type: integer format: int32 nullable: true userInfo: type: array items: $ref: '#/components/schemas/DeviceHeartbeatUserInfo' nullable: true serialNumber: type: string nullable: true additionalProperties: false ApiErrorResponse: type: object properties: errors: type: array items: $ref: '#/components/schemas/Error' nullable: true additionalProperties: false DeviceHeartbeatResponse: type: object properties: id: type: integer format: int32 deviceId: type: string format: uuid osVersion: type: string nullable: true appVersion: type: string nullable: true batteryPercentage: type: integer format: int32 batteryCurrentNow: type: integer format: int32 batteryCurrentAverage: type: integer format: int32 batteryVoltage: type: integer format: int32 batteryStatus: type: string nullable: true unsentSessions: type: integer format: int32 unfinishedSessions: type: integer format: int32 ioid: type: string nullable: true received: type: string format: date-time heartbeatUserInfo: type: array items: $ref: '#/components/schemas/DeviceHeartbeatUserinfoResponse' nullable: true additionalProperties: false NotificationsReceiver: type: object properties: id: type: integer format: int32 notificationId: type: integer format: int32 value: type: string nullable: true type: type: integer format: int32 deviceEventNotification: $ref: '#/components/schemas/DeviceEventNotification' additionalProperties: false securitySchemes: OAuth2: type: oauth2 flows: authorizationCode: authorizationUrl: https://identity.scanbro.com/connect/authorize tokenUrl: https://identity.scanbro.com/connect/token scopes: io.common: default scope