---
openapi: 3.0.0
info:
  title: GPS Illustration API
  description: GPS API for running Illustrations. You can generate a sample request in the Illustration System via Tools>Download API Requests
  contact:
    name: API Support
    email: API_Admin@glic.com
  version: 1.0.0
servers:
- url: https://api.guardianlife.com/gps-rest-api/illustrations
paths:
  /v1/illustration:
    post:
      summary: Post Illustrations.
      description: Post Illustrations
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IllustrationApi'
      responses:
        "200":
          description: Successful Illustration
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IllustrationApi'
        "500":
          description: Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IllustrationApi'
      security:
      - bearerHttpAuth:
        - admin
components:
  schemas:
    IllustrationApi:
      type: object
      properties:
        IllustrationApiRequest:
          type: array
          items:
            $ref: '#/components/schemas/IllustrationApiRequest'
        IllustrationApiResponse:
          type: array
          items:
            $ref: '#/components/schemas/IllustrationApiResponse'
        IllustrationApiError:
          type: array
          items:
            $ref: '#/components/schemas/IllustrationApiError'
      description: This is the base class for all requests and responses
    IllustrationApiRequest:
      type: object
      properties:
        Fields:
          type: array
          items:
            $ref: '#/components/schemas/Field'
        Profile:
          type: array
          items:
            $ref: '#/components/schemas/Request_Profile'
      description: Required in both requests and successful responses
    Field:
      type: object
      properties:
        Name:
          type: string
          example: ExecBonus.BonusAmount
        Value:
          type: string
          description: "Most values will be simple strings. This example is a schedule where {} represents a row and [] represents a column. You can design a field schedule in the web ui and then download the API request which will contain all the field values formatted for the API, including complex schedules like this."
          example: "{[0.00][][][][1][R-1]}"
      description: These are not strongly typed. They are name/value pairs where the name is a data element used by the Illustration System. For data element definitions see contextual help inside the Illustration System contextual help. You can also design a case using the web ui and then download an actual API request via the web ui TOOLS>Tools>Download API Requests menu item
    Request_Profile:
      type: object
      properties:
        CaseInfo:
          type: array
          items:
            $ref: '#/components/schemas/Request_Profile_CaseInfo'
        UseDefaultInput:
          type: boolean
          description: Seed request with defaults prior to applying passed input. This avoids validation errors for fields that are not passed in the request
        InstallGroup:
          type: string
          description: Install groups have access to certain Illustration features
          example: Home Office
        SelectedOutputTypes:
          type: array
          description: "When Values is chosen, all available reports will be returned as JSON objects. Other types will be returned as a Base64 encoded file. The list below is not comprehensive as output types vary by installGroup and client. Use the web ui to select different output types and then download an example request using the TOOLS menu for available valeus"
          items:
            type: string
            example: Values
            enum:
            - Values
            - PDF
            - CSV
            - Excel
            - XML
        MessageId:
          type: string
    Request_Profile_CaseInfo:
      type: object
      properties:
        Company:
          type: string
          example: WELIS
        Version:
          type: string
          description: autogenerated when downloaded from the API. Used to convert old input formats to new ones
          example: "0.31"
        CaseKey:
          type: string
          description: "When this SQL key is provided, historical input saved from a previous Illustration will be used. All other input will be ignored in favor of the historical input"
          example: "5454"
    IllustrationApiResponse:
      type: object
      properties:
        Illustration:
          type: array
          items:
            $ref: '#/components/schemas/Response_Illustration'
    Response_Illustration:
      type: object
      properties:
        Status:
          type: string
        MessageLog:
          type: string
        DebugMessages:
          type: array
          items:
            $ref: '#/components/schemas/Response_Illustration_DebugMessage'
        CaseId:
          type: string
          description: "The SQL key where input and data is saved for every Illustration. This key can later be submitted with a request to lookup the input, and re-run an Illustration by setting the CaseKey property"
        Reports:
          type: array
          description: Generated when the Values output type is selected
          items:
            $ref: '#/components/schemas/Response_Illustration_Report'
    Response_Illustration_Report:
      type: object
      properties:
        Name:
          type: string
        Description:
          type: string
        Scalars:
          type: array
          items:
            $ref: '#/components/schemas/Response_Illustration_Report_Scalar'
        Vectors:
          type: array
          items:
            $ref: '#/components/schemas/Response_Illustration_Report_Vector'
      description: "As seen in the web ui, every report can have scalar or vector data. The API includes files as scalar base64 encoded data as well."
    Response_Illustration_Report_Scalar:
      type: object
      properties:
        Name:
          type: string
        Description:
          type: string
        Value:
          type: string
    Response_Illustration_Report_Vector:
      type: object
      properties:
        Name:
          type: string
        Description:
          type: string
        Value:
          type: array
          items:
            type: string
      description: Report Columns are represented with this object
    Response_Illustration_DebugMessage:
      type: object
      properties:
        Label:
          type: string
        Value:
          type: string
    IllustrationApiError:
      type: object
      properties:
        Status:
          type: string
        Message:
          type: string
  securitySchemes:
    bearerHttpAuth:
      type: http
      description: JWT token sent as bearer token
      scheme: bearer
      bearerFormat: JWT
