x-generator: NSwag v13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))
swagger: '2.0'
info:
  title: Absorb Integration API
  version: v2
consumes:
  - application/json
produces:
  - application/json
paths:
  /external-training/submissions:
    get:
      tags:
        - Submissions
      summary: List submissions.
      operationId: Submissions_GetSubmissions
      parameters:
        - type: string
          name: _filter
          in: query
          description: >-
            One or more filter operations to be performed on the collection.

            The referenced fields must allow filtering. See the respective
            report's schema for which fields can be filtered. 
                        
            Supports most of the [OData filter
            syntax](http://docs.oasis-open.org/odata/odata/v4.01/cs01/part2-url-conventions/odata-v4.01-cs01-part2-url-conventions.html#sec_SystemQueryOptionfilter).
                        
            Supported operations:
                * eq,
                * ne,
                * gt,
                * ge,
                * lt,
                * le,
                * and,
                * or,
                * not,
                * ()

            Supported functions:
                * substringof('value',fieldName),
                * endswith(fieldName,'value'),
                * startswith(fieldName,'value'),
                * tolower(fieldName),
                * toupper(fieldName)
                        
            Examples:

            * _filter=`firstname eq 'Jeffrey'`

            * _filter=`id eq guid'a14c149a-2ce0-41d4-b532-02189ad3cb22'`

            * _filter=`startsWith(lastname,'leb') or dateAdded ge
            datetime'1998-03-06T20:38:07Z'`
          x-nullable: true
        - type: string
          name: _sort
          in: query
          description: >-
            Optional list of comma-separated fields to sort the collection by.


            The referenced fields must allow sorting. See the respective
            report's schema for which fields can be sorted. 

            If not specified, all report fields are returned.


            To sort in a descending manner, prefix the field name with `-`. For
            example, 

            `_sort=name,-date`, sorts the collection of items by `name`
            (ascending) 

            and then by `date` (descending).
          x-nullable: true
        - type: string
          name: _limit
          in: query
          description: >-
            The maximum number of items to return in the current page of the
            collection.
          x-nullable: true
        - type: string
          name: _offset
          in: query
          description: The number of pages to offset into the collection.
          x-nullable: true
        - type: string
          name: x-api-key
          in: header
        - type: string
          name: x-api-version
          in: header
          description: '2'
      responses:
        '200':
          x-nullable: false
          description: ''
          schema:
            $ref: '#/definitions/SubmissionsResource'
        '422':
          x-nullable: false
          description: A validation error occured with the provided parameters.
          schema:
            $ref: '#/definitions/GenericErrorResponse'
      security:
        - api_key: []
    post:
      tags:
        - Submissions
      summary: Create a new submission.
      operationId: Submissions_CreateSubmission
      parameters:
        - name: request
          in: body
          description: The request to create a new submission.
          schema:
            $ref: '#/definitions/CreateSubmissionRequest'
          x-nullable: true
        - type: string
          name: x-api-key
          in: header
        - type: string
          name: x-api-version
          in: header
          description: '2'
      responses:
        '201':
          description: ''
        '404':
          x-nullable: false
          description: Template or user not found.
          schema:
            $ref: '#/definitions/GenericErrorResponse'
        '422':
          x-nullable: false
          description: A validation error occured with the provided parameters.
          schema:
            $ref: '#/definitions/GenericErrorResponse'
      security:
        - api_key: []
  /external-training/submissions/{id}:
    get:
      tags:
        - Submissions
      summary: Get submission by ID.
      operationId: Submissions_GetSubmission
      parameters:
        - type: string
          name: id
          in: path
          required: true
          description: The submission ID.
          format: guid
          x-nullable: false
        - type: string
          name: x-api-key
          in: header
        - type: string
          name: x-api-version
          in: header
          description: '2'
      responses:
        '200':
          x-nullable: false
          description: ''
          schema:
            $ref: '#/definitions/NonPagedSubmissionResource'
        '404':
          x-nullable: false
          description: The submission with the given ID does not exist.
          schema:
            $ref: '#/definitions/GenericErrorResponse'
      security:
        - api_key: []
    put:
      tags:
        - Submissions
      summary: Update an existing submission.
      operationId: Submissions_UpdateSubmission
      parameters:
        - type: string
          name: id
          in: path
          required: true
          description: The ID of the submission.
          format: guid
          x-nullable: false
        - name: requestBody
          in: body
          description: The request body to update a submission.
          schema:
            $ref: '#/definitions/UpdateSubmissionRequestBody'
          x-nullable: true
        - type: string
          name: x-api-key
          in: header
        - type: string
          name: x-api-version
          in: header
          description: '2'
      responses:
        '200':
          description: ''
        '404':
          x-nullable: false
          description: Template or submission not found.
          schema:
            $ref: '#/definitions/GenericErrorResponse'
        '422':
          x-nullable: false
          description: A validation error occured with the provided parameters.
          schema:
            $ref: '#/definitions/GenericErrorResponse'
      security:
        - api_key: []
  /external-training/templates:
    get:
      tags:
        - Templates
      summary: List templates.
      operationId: Templates_GetTemplates
      parameters:
        - type: string
          name: _filter
          in: query
          description: >-
            One or more filter operations to be performed on the collection.

            The referenced fields must allow filtering. See the respective
            report's schema for which fields can be filtered. 
                        
            Supports most of the [OData filter
            syntax](http://docs.oasis-open.org/odata/odata/v4.01/cs01/part2-url-conventions/odata-v4.01-cs01-part2-url-conventions.html#sec_SystemQueryOptionfilter).
                        
            Supported operations:
                * eq,
                * ne,
                * gt,
                * ge,
                * lt,
                * le,
                * and,
                * or,
                * not,
                * ()

            Supported functions:
                * substringof('value',fieldName),
                * endswith(fieldName,'value'),
                * startswith(fieldName,'value'),
                * tolower(fieldName),
                * toupper(fieldName)
                        
            Examples:

            * _filter=`firstname eq 'Jeffrey'`

            * _filter=`id eq guid'a14c149a-2ce0-41d4-b532-02189ad3cb22'`

            * _filter=`startsWith(lastname,'leb') or dateAdded ge
            datetime'1998-03-06T20:38:07Z'`
          x-nullable: true
        - type: string
          name: _sort
          in: query
          description: >-
            Optional list of comma-separated fields to sort the collection by.


            The referenced fields must allow sorting. See the respective
            report's schema for which fields can be sorted. 

            If not specified, all report fields are returned.


            To sort in a descending manner, prefix the field name with `-`. For
            example, 

            `_sort=name,-date`, sorts the collection of items by `name`
            (ascending) 

            and then by `date` (descending).
          x-nullable: true
        - type: string
          name: _limit
          in: query
          description: >-
            The maximum number of items to return in the current page of the
            collection.
          x-nullable: true
        - type: string
          name: _offset
          in: query
          description: The number of pages to offset into the collection.
          x-nullable: true
        - type: string
          name: x-api-key
          in: header
        - type: string
          name: x-api-version
          in: header
          description: '2'
      responses:
        '200':
          x-nullable: false
          description: ''
          schema:
            $ref: '#/definitions/TemplatesResource'
        '422':
          x-nullable: false
          description: A validation error occured with the provided parameters.
          schema:
            $ref: '#/definitions/GenericErrorResponse'
      security:
        - api_key: []
  /external-training/templates/{id}:
    get:
      tags:
        - Templates
      summary: Get template by ID.
      operationId: Templates_GetTemplate
      parameters:
        - type: string
          name: id
          in: path
          required: true
          description: The template ID.
          format: guid
          x-nullable: false
        - type: string
          name: x-api-key
          in: header
        - type: string
          name: x-api-version
          in: header
          description: '2'
      responses:
        '200':
          x-nullable: false
          description: ''
          schema:
            $ref: '#/definitions/NonPagedTemplateResource'
        '404':
          x-nullable: false
          description: The template with the given ID does not exist.
          schema:
            $ref: '#/definitions/GenericErrorResponse'
      security:
        - api_key: []
definitions:
  SubmissionsResource:
    type: object
    description: Represents a collection of SubmissionResource
    properties:
      totalItems:
        type: integer
        description: The total number of items in the unbounded collection
        format: int32
      returnedItems:
        type: integer
        description: The number of items in the bound collection being returned
        format: int32
      limit:
        type: integer
        description: The current page size for the collection
        format: int32
      offset:
        type: integer
        description: The current offset for the collection
        format: int32
      submissions:
        type: array
        description: The paged collection of submissions.
        items:
          $ref: '#/definitions/SubmissionResource'
  Link:
    type: object
    properties:
      Rel:
        $ref: '#/definitions/Relation'
      Items:
        type: array
        items:
          $ref: '#/definitions/LinkItem'
  Relation:
    type: object
    properties:
      Name:
        type: string
  LinkItem:
    type: object
    properties:
      Href:
        type: string
      Name:
        type: string
      Templated:
        type: boolean
      Type:
        type: string
      Deprecation:
        type: string
      Profile:
        type: string
      Title:
        type: string
      Hreflang:
        type: string
  IEmbeddedResource:
    type: object
    x-abstract: true
    properties:
      Name:
        type: string
      Resources:
        type: array
        items:
          $ref: '#/definitions/IResource'
  IResource:
    type: object
    x-abstract: true
    properties:
      Links:
        type: array
        items:
          $ref: '#/definitions/Link'
      EmbeddedResources:
        type: array
        items:
          $ref: '#/definitions/IEmbeddedResource'
  SubmissionResource:
    type: object
    description: Resource for a submission.
    properties:
      id:
        type: string
        description: |-
          `Filterable` 

          The ID of the submission.
        format: guid
      userId:
        type: string
        description: |-
          `Filterable` 

          The ID of the user the submission is for.
        format: guid
      templateId:
        type: string
        description: |-
          `Filterable` 

          The ID of the template used for this submission.
        format: guid
      title:
        type: string
        description: |-
          `Sortable` `Filterable` 

          The title of the submission.
      completionDate:
        type: string
        description: |-
          `Sortable` `Filterable` 

          The date/time the submission was completed.
        format: date-time
      cost:
        type: string
        description: |-
          `Sortable` `Filterable` 

          The cost of the course.
      credits:
        type: number
        description: |-
          `Sortable` `Filterable` 

          The credits earned for completing this course.
        format: decimal
      description:
        type: string
        description: |-
          `Filterable` 

          The submission description.
      expiryDate:
        type: string
        description: |-
          `Sortable` `Filterable` 

          The expiry date of the course.
        format: date-time
      score:
        type: number
        description: |-
          `Sortable` `Filterable` 

          The score earned (in percentage) for completing this course.
        format: decimal
      startDate:
        type: string
        description: |-
          `Sortable` `Filterable` 

          The start date of the course.
        format: date-time
      totalTimeSpent:
        type: number
        description: |-
          `Sortable` `Filterable` 

          The total time spent taking this course.
        format: double
      vendor:
        type: string
        description: |-
          `Sortable` `Filterable` 

          The vendor who provided the course.
      vendorAddress:
        type: string
        description: |-
          `Filterable` 

          The address of the vendor.
      grade:
        type: string
        description: |-
          `Sortable` `Filterable` 

          The grade received for completing the course.
      status:
        description: >-
          `Sortable` `Filterable` 


          The status of the submission.


          Possible Enum Values: `0 = PendingApproval` `1 = Approved` `2 =
          Declined` 
        allOf:
          - $ref: '#/definitions/ExternalTrainingSubmissionStatus'
  ExternalTrainingSubmissionStatus:
    type: integer
    description: An enumeration of external training submission statuses.
    x-enumNames:
      - PendingApproval
      - Approved
      - Declined
    enum:
      - 0
      - 1
      - 2
  GenericErrorResponse:
    type: object
    description: |-
      This class is NOT to be used as an actual response. This is to be used as
      the return type for non-200 responses in `SwaggerResponse` attributes.
    properties:
      validations:
        type: array
        description: The validations (if any) which caused the error.
        items:
          type: string
      code:
        description: The status code returned.
        allOf:
          - $ref: '#/definitions/HttpStatusCode'
      message:
        type: string
        description: The error message.
      term:
        type: string
        description: The general error term.
      _meta:
        type: object
        description: 'A list of meta data (if any). '
        additionalProperties:
          type: string
  HttpStatusCode:
    type: integer
    description: ''
    x-enumNames:
      - Continue
      - SwitchingProtocols
      - OK
      - Created
      - Accepted
      - NonAuthoritativeInformation
      - NoContent
      - ResetContent
      - PartialContent
      - MultipleChoices
      - Ambiguous
      - MovedPermanently
      - Moved
      - Found
      - Redirect
      - SeeOther
      - RedirectMethod
      - NotModified
      - UseProxy
      - Unused
      - TemporaryRedirect
      - RedirectKeepVerb
      - BadRequest
      - Unauthorized
      - PaymentRequired
      - Forbidden
      - NotFound
      - MethodNotAllowed
      - NotAcceptable
      - ProxyAuthenticationRequired
      - RequestTimeout
      - Conflict
      - Gone
      - LengthRequired
      - PreconditionFailed
      - RequestEntityTooLarge
      - RequestUriTooLong
      - UnsupportedMediaType
      - RequestedRangeNotSatisfiable
      - ExpectationFailed
      - UpgradeRequired
      - InternalServerError
      - NotImplemented
      - BadGateway
      - ServiceUnavailable
      - GatewayTimeout
      - HttpVersionNotSupported
  NonPagedSubmissionResource:
    type: object
    description: >-
      This class is NOT to be used as an actual response. This is to be used as
      the `SwaggerResponse` return type for

      non-paginated endpoints that return SubmissionResource.
    properties:
      id:
        type: string
        description: The ID of the submission.
        format: guid
      userId:
        type: string
        description: The ID of the user the submission is for.
        format: guid
      templateId:
        type: string
        description: The ID of the template used for this submission.
        format: guid
      title:
        type: string
        description: The title of the submission.
      completionDate:
        type: string
        description: The date/time the submission was completed.
        format: date-time
      cost:
        type: string
        description: The cost of the course.
      credits:
        type: number
        description: The credits earned for completing this course.
        format: decimal
      description:
        type: string
        description: The submission description.
      expiryDate:
        type: string
        description: The expiry date of the course.
        format: date-time
      score:
        type: number
        description: The score earned (in percentage) for completing this course.
        format: decimal
      startDate:
        type: string
        description: The start date of the course.
        format: date-time
      totalTimeSpent:
        type: number
        description: The total time spent taking this course.
        format: double
      vendor:
        type: string
        description: The vendor who provided the course.
      vendorAddress:
        type: string
        description: The address of the vendor.
      grade:
        type: string
        description: The grade received for completing the course.
      status:
        description: >-
          The status of the submission.


          Possible Enum Values: `0 = PendingApproval` `1 = Approved` `2 =
          Declined` 
        allOf:
          - $ref: '#/definitions/ExternalTrainingSubmissionStatus'
  CreateSubmissionRequest:
    type: object
    description: Request to create an external training submission.
    required:
      - title
      - userId
      - templateId
      - completionDate
    properties:
      title:
        type: string
        description: The submission title.
        maxLength: 255
        minLength: 1
      userId:
        type: string
        description: The user ID.
        format: guid
        minLength: 1
      templateId:
        type: string
        description: The template ID this submission is based on.
        format: guid
        minLength: 1
      completionDate:
        type: string
        description: The date the course was completed.
        format: date-time
        minLength: 1
      status:
        description: >-
          The status of the submission.


          Possible Enum Values: `0 = PendingApproval` `1 = Approved` `2 =
          Declined` 
        allOf:
          - $ref: '#/definitions/ExternalTrainingSubmissionStatus'
      cost:
        type: string
        description: The cost of the course.
        maxLength: 255
      credits:
        type: number
        description: The credits earned for completing this course.
        format: decimal
        maximum: 1000000
        minimum: 0
      description:
        type: string
        description: The submission description.
        maxLength: 10000
      expiryDate:
        type: string
        description: The expiry date of the course.
        format: date-time
      startDate:
        type: string
        description: The start date of the course.
        format: date-time
      score:
        type: number
        description: The score earned (in percentage) for completing this course.
        format: decimal
        maximum: 100
        minimum: 0
      grade:
        type: string
        description: The grade received for completing the course.
        maxLength: 255
      totalTimeSpent:
        type: number
        description: The total time spent taking this course in hours.
        format: double
        maximum: 1000000
        minimum: 0
      vendor:
        type: string
        description: The vendor who provided the course.
        maxLength: 255
      vendorAddress:
        type: string
        description: The address of the vendor.
        maxLength: 255
  UpdateSubmissionRequestBody:
    type: object
    description: The request to update an external training submission.
    required:
      - title
      - completionDate
    properties:
      title:
        type: string
        description: The submission title.
        maxLength: 255
        minLength: 1
      completionDate:
        type: string
        description: The date the course was completed.
        format: date-time
        minLength: 1
      status:
        description: >-
          The status of the submission.


          Possible Enum Values: `0 = PendingApproval` `1 = Approved` `2 =
          Declined` 
        allOf:
          - $ref: '#/definitions/ExternalTrainingSubmissionStatus'
      cost:
        type: string
        description: The cost of the course.
        maxLength: 255
      credits:
        type: number
        description: The credits earned for completing this course.
        format: decimal
        maximum: 1000000
        minimum: 0
      description:
        type: string
        description: The submission description.
        maxLength: 10000
      expiryDate:
        type: string
        description: The expiry date of the course.
        format: date-time
      startDate:
        type: string
        description: The start date of the course.
        format: date-time
      score:
        type: number
        description: The score earned (in percentage) for completing this course.
        format: decimal
        maximum: 100
        minimum: 0
      grade:
        type: string
        description: The grade received for completing the course.
        maxLength: 255
      totalTimeSpent:
        type: number
        description: The total time spent taking this course in hours.
        format: double
        maximum: 1000000
        minimum: 0
      vendor:
        type: string
        description: The vendor who provided the course.
        maxLength: 255
      vendorAddress:
        type: string
        description: The address of the vendor.
        maxLength: 255
  TemplatesResource:
    type: object
    description: Represents a collection of TemplateResource
    properties:
      totalItems:
        type: integer
        description: The total number of items in the unbounded collection
        format: int32
      returnedItems:
        type: integer
        description: The number of items in the bound collection being returned
        format: int32
      limit:
        type: integer
        description: The current page size for the collection
        format: int32
      offset:
        type: integer
        description: The current offset for the collection
        format: int32
      templates:
        type: array
        description: The paged collection of templates.
        items:
          $ref: '#/definitions/TemplateResource'
  TemplateResource:
    type: object
    description: Resource for a template.
    properties:
      id:
        type: string
        description: |-
          `Filterable` 

          The ID of the template.
        format: guid
      name:
        type: string
        description: |-
          `Sortable` `Filterable` 

          The name of the template.
      isActive:
        type: boolean
        description: |-
          `Sortable` `Filterable` 

          True if the template is currently active; false otherwise
  NonPagedTemplateResource:
    type: object
    description: >-
      This class is NOT to be used as an actual response. This is to be used as
      the `SwaggerResponse` return type for

      non-paginated endpoints that return TemplateResource.
    properties:
      id:
        type: string
        description: The ID of the template.
        format: guid
      name:
        type: string
        description: The name of the template.
      isActive:
        type: boolean
        description: True if the template is currently active; false otherwise
securityDefinitions:
  api_key:
    type: apiKey
    name: x-api-key
    in: header
tags:
  - name: Submissions
  - name: Templates
x-servers:
  - url: https://rest.myabsorb.com
    description: US
  - url: https://rest.myabsorb.ca
    description: CA
  - url: https://rest.myabsorb.eu
    description: EU
  - url: https://rest.myabsorb.com.au
    description: AU
