openapi: 3.2.0 info: title: Device Directory App API version: 3.0.0 tags: - name: App paths: /apps/{appId}/hosts/{hostId}: get: tags: - App summary: Get a host description: Endpoint to fetch a host. parameters: - name: appId in: path description: Unique identifier for the app. required: true schema: type: string - name: hostId in: path description: Unique identifier for the host. required: true schema: type: string responses: '200': description: Device fetched successfully. content: application/json: schema: $ref: '#/components/schemas/Host' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /apps/{appId}/terminals/{terminalId}: get: tags: - App summary: Get a terminal description: Endpoint to get a terminal. parameters: - name: appId in: path description: Unique identifier for the app. required: true schema: type: string - name: terminalId in: path description: Unique identifier for the terminal. required: true schema: type: string responses: '200': description: Get a terminal. content: application/json: schema: $ref: '#/components/schemas/TerminalAppResponse' '404': description: Terminal not found. /apps/{appId}/devices/{deviceId}: get: tags: - App summary: Get a device description: Endpoint to fetch device. parameters: - name: appId in: path description: Unique identifier for the app. required: true schema: type: string - name: deviceId in: path description: Unique identifier for the device. required: true schema: type: string responses: '200': description: Devices fetched successfully. content: application/json: schema: $ref: '#/components/schemas/Device' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /apps/{appId}/terminals/{terminalId}/activate: post: tags: - App summary: Activate a terminal. description: Endpoint to activate a terminal. parameters: - name: appId in: path description: Unique identifier for the app. required: true schema: type: string - name: terminalId in: path description: Unique identifier for the terminal. required: true schema: type: string - name: idempotency-key in: header description: A unique key to ensure idempotent requests. It should be a UUID or unique string to prevent duplicate transactions. required: false schema: type: string example: f5033990-1965-4bd6-86d5-cdc274164553 requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/TerminalActivateRequest' responses: '200': description: Terminal activated. content: application/json: schema: $ref: '#/components/schemas/TerminalActivatedResponse' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '422': description: Unprocessable Entity, validation errors. content: application/problem+json: schema: $ref: '#/components/schemas/ValidationProblemDetails' components: schemas: Host: type: object properties: id: type: integer description: Unique identifier for the Host. example: 844456 url: type: integer description: Host URL. example: https://host.example externalReferenceId: type: string description: Host external reference id. example: '02' createdAt: type: string format: date-time description: Created at. example: '2024-09-26T14:45:30.123+02:00' updatedAt: type: string format: date-time description: Updated at. example: '2024-09-26T14:45:30.123+02:00' TerminalActivateRequest: type: object required: - activationCode properties: activationCode: type: string description: Model version of device. example: '0000000' minLength: 6 TerminalActivatedResponse: type: object properties: id: type: integer description: Unique identifier for the Terminal. example: 844456 externalReferenceId: type: string description: Device external reference id. example: a4288161-c772-43d2-831d-ee4cdc09864d deviceId: type: integer description: Device id. example: 1 createdAt: type: string format: date-time description: Created at. example: '2024-09-26T14:45:30.123+02:00' updatedAt: type: string format: date-time description: Updated at. example: '2024-09-26T14:45:30.123+02:00' activatedAt: type: string format: date-time description: Updated at. example: '2024-09-26T14:45:30.123+02:00' ValidationProblemDetails: type: object properties: type: type: string description: A URI reference that identifies the problem type. example: https://example.com/probs/validation-error detail: type: string description: A human-readable explanation specific to this occurrence of the problem. example: The request body contains invalid fields. violations: type: array items: type: object properties: field: type: string description: The name of the field that failed validation. example: field message: type: string description: A description of the validation failure. example: This value is too long. It should have {{ limit }} characters or less. Violation: type: object properties: propertyPath: type: string description: The path to the parameter or property where the violation occurred. code: type: string description: Specific error code representing the violation. message: type: string description: A message describing what went wrong. ErrorResponse: type: object properties: message: type: string description: A description of the error that occurred. example: Error occured. violations: type: array description: List of validation errors or violations. items: $ref: '#/components/schemas/Violation' Device: type: object properties: id: type: integer description: Unique identifier for the Device. example: 844456 externalReferenceId: type: string description: Device external reference id. example: a4288161-c772-43d2-831d-ee4cdc09864d serialNumber: type: string description: Model version of device. example: SP000000004 configurationTag: type: string description: Model version of device. example: test-v1-all-all hostId: type: integer description: Host unique identifier. example: 1 createdAt: type: string format: date-time description: Created at. example: '2024-09-26T14:45:30.123+02:00' updatedAt: type: string format: date-time description: Updated at. example: '2024-09-26T14:45:30.123+02:00' TerminalAppResponse: type: object properties: id: type: integer description: Unique identifier for the Terminal. example: 844456 externalReferenceId: type: string description: Device external reference id. example: a4288161-c772-43d2-831d-ee4cdc09864d deviceId: type: integer description: Device id. example: 1 createdAt: type: string format: date-time description: Created at. example: '2024-09-26T14:45:30.123+02:00' updatedAt: type: string format: date-time description: Updated at. example: '2024-09-26T14:45:30.123+02:00' activatedAt: type: string format: date-time description: Updated at. example: '2024-09-26T14:45:30.123+02:00'