openapi: 3.0.1
info:
  title: Vasion External Gateway API
  version: v1.0.0
  contact:
    name: PrinterLogic Support
    url: https://vasion.com/technical-support/
    email: support@printerlogic.com
servers:
  - url: https://external-api.app.printercloud.com
  - url: https://external-api.app.printercloud5.com
  - url: https://external-api.app.printercloud6.com
  - url: https://external-api.app.printercloud10.com
  - url: https://external-api.app.printercloud15.com
  - url: https://external-api.app.printercloud20.com
  - url: https://external-api.app.printercloudnow.com
tags: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
  schemas:
    IppResolution:
      type: object
      description: A single resolution option reported by the printer.
      properties:
        xres:
          type: integer
          format: int32
          description: Horizontal resolution.
        yres:
          type: integer
          format: int32
          description: Vertical resolution.
        units:
          type: integer
          format: int32
          description: IPP resolution unit. 3 = dots per inch, 4 = dots per centimeter.
    IppCopiesSupported:
      type: object
      description: Range of copy counts the printer will accept for a single job.
      properties:
        lower:
          type: integer
          format: int32
          description: Minimum number of copies supported.
        upper:
          type: integer
          format: int32
          description: Maximum number of copies supported.
    IppPrinterAttributes:
      type: object
      additionalProperties: true
      description: >-
        A map of IPP attributes returned by the printer. Keys are IPP attribute
        names in their original kebab-case form (e.g. "printer-state",
        "color-supported"). Value type depends on the attribute: most are a
        scalar (string, integer, or boolean) or an array of scalars, but a few
        (such as pwg-raster-document-resolution-supported and
        copies-supported) are arrays of objects or a single object. The
        properties below document the attributes most commonly requested;
        any attribute supported by the printer and not listed here will still
        be included in the response.
      properties:
        printer-name:
          type: string
          description: The printer's IPP-reported name.
        printer-state:
          type: integer
          format: int32
          description: >-
            IPP printer state. 3 = idle, 4 = processing, 5 = stopped.
          enum: [3, 4, 5]
        printer-state-reasons:
          type: array
          description: Machine-readable reasons for the current printer state. "none" indicates no special condition.
          items:
            type: string
        printer-is-accepting-jobs:
          type: boolean
          description: Whether the printer is currently accepting new print jobs.
        color-supported:
          type: boolean
          description: Whether the printer supports color output.
        document-format-supported:
          type: array
          description: MIME types the printer can accept for print jobs.
          items:
            type: string
        ipp-versions-supported:
          type: array
          description: IPP protocol versions supported by the printer.
          items:
            type: string
        sides-supported:
          type: array
          description: Duplex modes supported by the printer.
          items:
            type: string
        copies-supported:
          $ref: "#/components/schemas/IppCopiesSupported"
        printer-uri-supported:
          type: array
          description: URIs (IPP/IPPS) the printer can be reached at.
          items:
            type: string
            format: uri
        pwg-raster-document-resolution-supported:
          type: array
          description: Print resolutions supported by the printer, in PWG raster terms.
          items:
            $ref: "#/components/schemas/IppResolution"
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Human-readable description of what went wrong.
paths:
  /v1/printers/{printerName}/ipp:
    parameters:
    - name: printerName
      in: path
      description: The name of the printer as it appears in the PrinterLogic Portal.
      required: true
      schema:
        type: string
      example: HP-LaserJet-4
    - name: attributes
      in: query
      description: >-
        Comma-separated list of IPP attribute names to request from the
        printer, using IPP kebab-case (e.g. "printer-state"). When omitted,
        all attributes are requested.
      required: false
      schema:
        type: string
      example: printer-state,printer-state-reasons,color-supported,document-format-supported
    get:
      security:
        - bearerAuth: []
      tags:
        - DEFAULT
      summary: Get IPP printer attributes for an off-network printer
      description: |-
        Builds an IPP Get-Printer-Attributes request and proxies it through
        the Off-Network gateway to the physical printer,
        returning the printer's IPP response as a JSON attribute map. Only
        available for printers that are configured for off-network printing.

        This request returns the attributes received from the printer, the fields available will vary by printer make/model. See https://datatracker.ietf.org/doc/html/rfc8011#section-5.4 for a list of commonly supported printer attributes and their meaning.
      responses:
        '200':
          description: OK - Printer attribute map.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/IppPrinterAttributes"
              example: |-
                {
                  "printer-name": "HP LaserJet 4",
                  "printer-state": 3,
                  "printer-state-reasons": ["none"],
                  "printer-is-accepting-jobs": true,
                  "color-supported": false,
                  "document-format-supported": ["application/pdf", "application/octet-stream"],
                  "ipp-versions-supported": ["1.1", "2.0"],
                  "pwg-raster-document-resolution-supported": [
                    {"xres": 300, "yres": 300, "units": 3},
                    {"xres": 600, "yres": 600, "units": 3}
                  ]
                }
        '400':
          description: BAD REQUEST - The printer may not be configured for off-network printing.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        '401':
          description: UNAUTHORIZED
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        '404':
          description: NOT FOUND - No printer with the given name exists.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        '429':
          description: TOO MANY REQUESTS - Rate Limit 1/s.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        '502':
          description: BAD GATEWAY - The IRS successfully tried to connect to the printer but did not get a response. This may indicate the printer is offline, does not support IPP, or IPP is disabled on the printer.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        '504':
          description: GATEWAY TIMEOUT
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        '500':
          description: INTERNAL SERVER ERROR
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"