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: v1
consumes:
  - application/json
produces:
  - application/json
paths:
  /question-banks:
    get:
      tags:
        - Question Banks
      summary: List question banks.
      operationId: QuestionBanks_GetQuestionBanks
      parameters:
        - 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: '1'
      responses:
        '200':
          x-nullable: false
          description: ''
          schema:
            $ref: '#/definitions/QuestionBanksResource'
        '422':
          x-nullable: false
          description: A validation error occured with the provided parameters.
          schema:
            $ref: '#/definitions/GenericErrorResponse'
      security:
        - api_key: []
    post:
      tags:
        - Question Banks
      summary: Create question bank.
      operationId: QuestionBanks_CreateQuestionBank
      parameters:
        - name: request
          in: body
          description: The request to create a new question bank.
          schema:
            $ref: '#/definitions/CreateQuestionBankRequest'
          x-nullable: true
        - type: string
          name: x-api-key
          in: header
        - type: string
          name: x-api-version
          in: header
          description: '1'
      responses:
        '201':
          x-nullable: false
          description: ''
          schema:
            $ref: '#/definitions/QuestionBankResource'
        '403':
          x-nullable: false
          description: User is not allowed to update the given question bank.
          schema:
            $ref: '#/definitions/GenericErrorResponse'
        '409':
          x-nullable: false
          description: Question bank already exists with given ID.
          schema:
            $ref: '#/definitions/GenericErrorResponse'
        '422':
          x-nullable: false
          description: A validation error occured with the provided parameters.
          schema:
            $ref: '#/definitions/GenericErrorResponse'
      security:
        - api_key: []
  /question-banks/{questionBankId}:
    get:
      tags:
        - Question Banks
      summary: Get question bank.
      operationId: QuestionBanks_GetQuestionBank
      parameters:
        - type: string
          name: questionBankId
          in: path
          required: true
          description: The unique question bank identifier.
          format: guid
          x-nullable: false
        - type: string
          name: x-api-key
          in: header
        - type: string
          name: x-api-version
          in: header
          description: '1'
      responses:
        '200':
          x-nullable: false
          description: ''
          schema:
            $ref: '#/definitions/QuestionBankResource'
        '404':
          x-nullable: false
          description: Question Bank 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: []
    put:
      tags:
        - Question Banks
      summary: Update question bank.
      operationId: QuestionBanks_UpdateQuestionBank
      parameters:
        - type: string
          name: questionBankId
          in: path
          required: true
          description: The unique question bank identifier.
          format: guid
          x-nullable: false
        - name: questionBank
          in: body
          description: The model for the question bank data.
          schema:
            $ref: '#/definitions/UpdateQuestionBankRequestBody'
          x-nullable: true
        - type: string
          name: x-api-key
          in: header
        - type: string
          name: x-api-version
          in: header
          description: '1'
      responses:
        '200':
          x-nullable: false
          description: ''
          schema:
            $ref: '#/definitions/QuestionBankResource'
        '403':
          x-nullable: false
          description: User does not have permission to edit the given question bank.
          schema:
            $ref: '#/definitions/GenericErrorResponse'
        '404':
          x-nullable: false
          description: Question bank 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: []
  /question-banks/{questionBankId}/questions/{questionId}:
    get:
      tags:
        - Question Bank Questions
      summary: Get question bank question.
      operationId: QuestionBankQuestions_GetQuestionBankQuestion
      parameters:
        - type: string
          name: questionBankId
          in: path
          required: true
          description: The unique question bank identifier.
          format: guid
          x-nullable: false
        - type: string
          name: questionId
          in: path
          required: true
          description: The unique question identifier.
          format: guid
          x-nullable: false
        - type: string
          name: x-api-key
          in: header
        - type: string
          name: x-api-version
          in: header
          description: '1'
      responses:
        '200':
          x-nullable: false
          description: ''
          schema:
            $ref: '#/definitions/QuestionBankQuestionResource'
        '404':
          x-nullable: false
          description: Question or question bank not found.
          schema:
            $ref: '#/definitions/GenericErrorResponse'
      security:
        - api_key: []
    put:
      tags:
        - Question Bank Questions
      summary: Updates a question bank question
      operationId: QuestionBankQuestions_UpdateQuestionBankQuestions
      parameters:
        - type: string
          name: questionId
          in: path
          required: true
          description: The ID of the question.
          format: guid
          x-nullable: false
        - type: string
          name: questionBankId
          in: path
          required: true
          description: The ID of the question bank.
          format: guid
          x-nullable: false
        - name: requestBody
          in: body
          description: The request body to list question bank questions.
          schema:
            $ref: '#/definitions/UpdateQuestionBankQuestionRequestBody'
          x-nullable: true
        - type: string
          name: x-api-key
          in: header
        - type: string
          name: x-api-version
          in: header
          description: '1'
      responses:
        '200':
          x-nullable: false
          description: ''
          schema:
            $ref: '#/definitions/QuestionBankQuestionResource'
        '404':
          x-nullable: false
          description: Question not found.
          schema:
            $ref: '#/definitions/GenericErrorResponse'
      security:
        - api_key: []
  /question-banks/{questionBankId}/questions:
    get:
      tags:
        - Question Bank Questions
      summary: List question bank questions
      operationId: QuestionBankQuestions_GetQuestionBankQuestions
      parameters:
        - type: string
          name: questionBankId
          in: path
          required: true
          description: The unique question bank identifier.
          format: guid
          x-nullable: false
        - 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: '1'
      responses:
        '200':
          x-nullable: false
          description: ''
          schema:
            $ref: '#/definitions/QuestionBankQuestionsResource'
        '422':
          x-nullable: false
          description: A validation error occured with the provided parameters.
          schema:
            $ref: '#/definitions/GenericErrorResponse'
      security:
        - api_key: []
    post:
      tags:
        - Question Bank Questions
      summary: Create question bank question
      description: Creates and returns a new question bank question.
      operationId: QuestionBankQuestions_CreateQuestionBankQuestion
      parameters:
        - type: string
          name: questionBankId
          in: path
          required: true
          description: The ID of the question bank.
          format: guid
          x-nullable: false
        - name: requestBody
          in: body
          description: The request body to create a new question bank question.
          schema:
            $ref: '#/definitions/CreateQuestionBankQuestionRequestBody'
          x-nullable: true
        - type: string
          name: x-api-key
          in: header
        - type: string
          name: x-api-version
          in: header
          description: '1'
      responses:
        '201':
          x-nullable: false
          description: ''
          schema:
            $ref: '#/definitions/QuestionBankQuestionResource'
        '404':
          x-nullable: false
          description: Question bank not found.
          schema:
            $ref: '#/definitions/GenericErrorResponse'
      security:
        - api_key: []
definitions:
  QuestionBanksResource:
    type: object
    description: Represents a paged collection of QuestionBankResource.
    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
      questionBanks:
        type: array
        description: The paged collection of resources.
        items:
          $ref: '#/definitions/QuestionBankResource'
  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'
  QuestionBankResource:
    type: object
    description: Represents information about a question bank in the Integration API.
    properties:
      id:
        type: string
        description: The unique question bank identifier.
        format: guid
      name:
        type: string
        description: The question bank name.
  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
  CreateQuestionBankRequest:
    type: object
    description: Request to create a new question bank.
    required:
      - name
    properties:
      id:
        type: string
        description: >-
          The unique question bank identifier. If not supplied, one will be
          created.
        format: guid
      name:
        type: string
        description: The question bank name.
        maxLength: 255
        minLength: 0
  UpdateQuestionBankRequestBody:
    type: object
    description: The request body to update a question bank.
    required:
      - name
    properties:
      name:
        type: string
        description: The question bank name.
        maxLength: 255
        minLength: 0
  QuestionBankQuestionResource:
    type: object
    description: >-
      Represents information about a question bank question in the Integration
      API.
    properties:
      id:
        type: string
        description: The unique question identifier.
        format: guid
      name:
        type: string
        description: The question name.
      correctReply:
        type: string
        description: The correct reply to the question.
      incorrectReply:
        type: string
        description: The incorrect reply to the question.
      questionType:
        description: >-
          The question type.


          Possible Enum Values: `0 = SingleAnswer` `1 = MultipleAnswer` `2 =
          Text` 
        allOf:
          - $ref: '#/definitions/ExamQuestionType'
      attachment:
        type: string
        description: |-
          The attachment to use for the question.
                      
          Note: URL or file.
      questionOptions:
        type: array
        description: The question options.
        items:
          $ref: '#/definitions/QuestionOptionResource'
  ExamQuestionType:
    type: integer
    description: Describes the type of an exam question.
    x-enumNames:
      - SingleAnswer
      - MultipleAnswer
      - Text
    enum:
      - 0
      - 1
      - 2
  QuestionOptionResource:
    type: object
    description: Represents information about a question option in the Integration API.
    properties:
      id:
        type: string
        description: The unique question option identifier.
        format: guid
      name:
        type: string
        description: The question option name.
      isCorrect:
        type: boolean
        description: >-
          True if the option is the correct answer for a question; false
          otherwise.
      order:
        type: integer
        description: The question option order.
        format: int32
  QuestionBankQuestionsResource:
    type: object
    description: Represents a paged collection of QuestionBankQuestionResource.
    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
      questionBanks:
        type: array
        description: The paged collection of resources.
        items:
          $ref: '#/definitions/QuestionBankQuestionResource'
  UpdateQuestionBankQuestionRequestBody:
    type: object
    description: The request body to update a question bank question.
    required:
      - questionType
      - name
      - questionOptions
    properties:
      questionType:
        description: >-
          Type of question.
           

          Possible Enum Values: `SingleAnswer = SingleAnswer` `MultipleAnswer =
          MultipleAnswer` `Text = Text` 
        allOf:
          - $ref: '#/definitions/ExamQuestionType2'
      name:
        type: string
        description: Name of the question.
        maxLength: 4000
        minLength: 0
      correctReply:
        type: string
        description: Correct reply to the question.
        maxLength: 2000
        minLength: 0
      incorrectReply:
        type: string
        description: Incorrect reply to the question.
        maxLength: 2000
        minLength: 0
      attachment:
        type: string
        description: |-
          Attachment to use for the question.
                      
          Note: URL or file.
        maxLength: 255
        minLength: 0
      questionOptions:
        type: array
        description: The question options.
        items:
          $ref: '#/definitions/QuestionOptions'
  ExamQuestionType2:
    type: string
    description: Describes the type of an exam question.
    x-enumNames:
      - SingleAnswer
      - MultipleAnswer
      - Text
    enum:
      - SingleAnswer
      - MultipleAnswer
      - Text
  QuestionOptions:
    type: object
    description: An object defining an exam question option.
    required:
      - name
      - isCorrect
      - order
    properties:
      id:
        type: string
        description: The ID of the question option. If not supplied one will be created.
        format: guid
      name:
        type: string
        description: Name of the question/answer option.
        maxLength: 4000
        minLength: 1
      isCorrect:
        type: boolean
        description: >-
          True if the option is the correct answer for a question; false
          otherwise.
                      
          Note: `QuestionType` must be `SingleAnswer` or `MultipleAnswer` for
          property to be considered.
      order:
        type: integer
        description: The order of the question option
        format: int32
  CreateQuestionBankQuestionRequestBody:
    type: object
    description: The request body to create a question bank question.
    required:
      - questionType
      - name
      - questionOptions
    properties:
      id:
        type: string
        description: >-
          The new question bank question's ID. If not supplied one will be
          created.
        format: guid
      questionType:
        description: >-
          Type of question.
           

          Possible Enum Values: `SingleAnswer = SingleAnswer` `MultipleAnswer =
          MultipleAnswer` `Text = Text` 
        allOf:
          - $ref: '#/definitions/ExamQuestionType2'
      name:
        type: string
        description: Name of the question.
        maxLength: 4000
        minLength: 0
      correctReply:
        type: string
        description: Correct reply to the question.
        maxLength: 2000
        minLength: 0
      incorrectReply:
        type: string
        description: Incorrect reply to the question.
        maxLength: 2000
        minLength: 0
      attachment:
        type: string
        description: |-
          Attachment to use for the question.
                      
          Note: URL or file.
        maxLength: 255
        minLength: 0
      questionOptions:
        type: array
        description: The question options.
        items:
          $ref: '#/definitions/QuestionOptions'
securityDefinitions:
  api_key:
    type: apiKey
    name: x-api-key
    in: header
tags:
  - name: Question Banks
  - name: Question Bank Questions
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
