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-fed.us
tags: []
components:
  securitySchemes:  
    bearerAuth:
      type: http
      scheme: bearer
  schemas:
    Printer:
      type: object
      properties:
        comment:
          type: string
        consolePrinting: 
          type: integer
          format: int32
        disableSingleSignOn: 
          type: integer
          format: int32
        globalConsolePrinting: 
          type: integer
          format: int32
        globalDisableSingleSignOn: 
          type: integer
          format: int32
        hostAddress: 
          type: string
        id: 
          type: integer
          format: int32
        ipSearch: 
          type: string
        isByteCounting: 
          type: boolean
        isColor: 
          type: integer
          format: int32
        isPullPrinter: 
          type: integer
          format: int32
        isSnmpEnabled: 
          type: integer
          format: int32
        lastModified: 
          type: string
        location: 
          type: string
        make: 
          type: string
        model: 
          type: string
        portNumber: 
          type: integer
          format: int32
        protocol: 
          type: string
        pullPrint: 
          type: integer
          format: int32
        queueName: 
          type: string
        secureRelease: 
          type: integer
          format: int32
        snmpCommunity: 
          type: string
        snmpDeviceIndex:
          type: string
        supportsDuplex: 
          type: integer
          format: int32
        title: 
          type: string
    Printers: 
      type: array
      items: 
        $ref: "#/components/schemas/Printer"
paths:
  /v1/printers:
    parameters:
    - name: sort
      in: query
      description: Sort by field, defaults to id
      required: false
      schema:
        type: string
        enum: [id, title, host_address, make]
      example: id
    - name: order
      in: query
      description: Sort order, defaults to asc
      required: false
      schema:
        type: string
        enum: [asc, desc]
      example: asc
    - name: limit
      in: query
      description: Printers per page, defaults to 25
      required: false
      schema:
        type: integer
      example: 25
    - name: page
      in: query
      description: Page number, defaults to 1
      required: false
      schema:
        type: integer
      example: 1
    - name: ids
      in: query
      description: Filter by printer ids
      required: false
      schema: 
        type: string
      example: "[1,22,34]"
    - name: location
      in: query
      description: Filter by printer's location field
      required: false
      schema:
        type: string
      example: "IT Department"
    - name: comment
      in: query
      description: Filter by printer's comment field
      required: false
      schema:
        type: string
      example: Comment
    - name: name
      in: query
      description: Filter by printer's name, allows wildcards
      required: false
      schema:
        type: string
      example: HP*
    - name: customFieldFilter
      in: query
      description: Filter by printer's custom field
      required: false
      schema:
        type: object
      example: {"name": "Custom Field Name", "value": "Custom Field Value"}
    - name: path
      in: query
      description: Filter by printer's tree path, allows wildcard
      required: false
      schema:
        type: string
      example: My Company/Folder 1/*
    - name: fields
      in: query
      description: Filter the fields returned for each printer, if included, the fields sent are the only ones that will be returned
      required: false
      schema:
        type: string
      example: id,title,location,comment,hostAddress
    - name: additionalAttributes
      in: query
      description: Returns additional attributes as a field for each printer, if exists
      required: false
      schema:
        type: string
      example: output_management_print_language,output_management_tray_mapping_enabled
    - name: includeSnmpStatus
      in: query
      description: When true, includes SNMP status and related details in the response for each printer
      required: false
      schema:
        type: boolean
      example: true
    - name: customFields
      in: query
      description: Returns custom fields for each printer, if exists
      required: false
      schema:
        type: string
      example: Custom Field Name,Custom Field Name 2
    get:
      security:
        - bearerAuth: []
      tags:
        - default
      summary: Get printer information
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
              example: |-
                {
                  "printers": [
                    {
                      "id": 1,
                      "title": "Main Office Printer",
                      "location": "IT Department",
                      "comment": "Color printer near helpdesk",
                      "hostAddress": "192.168.1.100",
                      "make": "HP",
                      "model": "LaserJet Pro M404dn",
                      "protocol": "IPP",
                      "portNumber": 631,
                      "queueName": "main_office",
                      "isSnmpEnabled": 1,
                      "isByteCounting": true,
                      "isColor": 1,
                      "isPullPrinter": 0,
                      "lastModified": "2024-05-20T10:00:00Z",
                      "supportsDuplex": 1,
                      "secureRelease": 0,
                      "pullPrint": 0,
                      "consolePrinting": 1,
                      "globalConsolePrinting": 0,
                      "disableSingleSignOn": 0,
                      "globalDisableSingleSignOn": 0,
                      "snmpCommunity": "public",
                      "snmpDeviceIndex": "1",
                      "ipSearch": "192.168.1.*"
                    }
                  ],
                  "pagination": {
                    "totalPages": 1,
                    "perPage": 25,
                    "currentPage": 1,
                    "currentCount": 1,
                    "totalCount": 1
                  }
                }
        '400':
          description: BAD REQUEST
          content:
            text/plain:
              schema:
                type: string
        '401':
          description: UNAUTHORIZED
          content:
            text/plain:
              schema:
                type: string
        '429':
          description: TOO MANY REQUESTS
          content:
            text/plain:
              schema:
                type: string
        '500':
          description: INTERNAL SERVER ERROR
          content:
            text/plain:
              schema:
                type: string