openapi: 3.0.2
info:
  title: Claromentis Quiz API
  description: Claromentis Quiz API v2, Open API v3 specification.
  version: 2.0.0
  contact:
    name: Discover Claromentis
    url: https://discover.claromentis.com
externalDocs:
  description: Learn more about Claromentis APIs
  url: https://developer.claromentis.com
servers:
  - url: '{Protocol}{Hostname}/api/quiz/v2'
    variables:
      Protocol:
        enum:
          - https://
          - http://
        default: https://
      Hostname:
        default: 'yourintranet.com'
        description: Claromentis Server Instance
security:
  - HttpBasic: []
tags:
  - name: Quiz
    description: Quiz API
  - name: Survey
    description: Survey API
  - name: Poll
    description: Poll API
  - name: Attempt
    description: Attempt API
  - name: Attemptable
    description: Attemptable API

paths:
  /quizzes/{id}:
    get:
      tags:
        - Quiz
      summary: Get a specific Quiz
      parameters:
        - $ref: '#/components/parameters/ID'
      responses:
        200:
          $ref: '#/components/responses/Quiz'
        404:
          description: Quiz not found
  /quizzes/{id}/questions/{question_id}:
    get:
      tags:
        - Quiz
      summary: Get quiz questions
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/Question'
      responses:
        200:
          $ref: '#/components/responses/Questions'
        404:
          description: Questions not found
  /quizzes/{id}/questions/sort:
    post:
      tags:
        - Quiz
      summary: Change quiz questions sort order
      parameters:
        - $ref: '#/components/parameters/ID'
      requestBody:
        $ref: '#/components/requestBodies/SortOrder'
      responses:
        200:
          $ref: '#/components/responses/Status'
        404:
          description: Order not updated
  /quizzes/{id}/current_attempts:
    get:
      tags:
        - Quiz
      summary: Get quiz incomplete attempts
      parameters:
        - $ref: '#/components/parameters/ID'
      responses:
        200:
          $ref: '#/components/responses/Attempts'
        404:
          description: Quiz not found
  /quizzes:
    get:
      tags:
        - Quiz
      summary: Search Quizzes
      parameters:
        - $ref: '#/components/parameters/Query'
      responses:
        200:
          $ref: '#/components/responses/Quizzes'
        404:
          description: Quiz not found
  /quizzes/{id}/attempts:
    post:
      tags:
        - Quiz
      summary: Start Attempt
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/Object_type'
      responses:
        200:
          $ref: '#/components/responses/StartAttempt'
        404:
          description: Error starting attempt
  /attempts/{id}:
    put:
      tags:
        - Attempt
      summary: Update an Attempt
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/Object_type'
      requestBody:
        $ref: '#/components/requestBodies/UpdateAttempt'
      responses:
        200:
          $ref: '#/components/responses/UpdateAttempt'
        404:
          description: Error updating attempt
  /attempts/{id}/answers:
    post:
      tags:
        - Attempt
      summary: Answer questions
      parameters:
        - $ref: '#/components/parameters/ID'
      requestBody:
        $ref: '#/components/requestBodies/Answers'
      responses:
        200:
          $ref: '#/components/responses/Status'
        404:
          description: Order not updated
  /attempts/{id}/results:
    get:
      tags:
        - Attempt
      summary: Get attempt results
      parameters:
        - $ref: '#/components/parameters/ID'
      responses:
        200:
          $ref: '#/components/responses/UpdateAttempt'
        404:
          description: Error updating attempt
  /surveys:
    get:
      tags:
        - Survey
      summary: Get Surveys
      parameters:
        - $ref: '#/components/parameters/Query'
      responses:
        200:
          $ref: '#/components/responses/Surveys'
        404:
          description: Quiz not found
    post:
      tags:
        - Survey
      summary: Create a new Survey
      requestBody:
        $ref: '#/components/requestBodies/Survey'
      responses:
        200:
          description: The created Survey
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Survey'
  /surveys/{id}:
    get:
      tags:
        - Survey
      summary: Get a specific Survey
      parameters:
        - $ref: '#/components/parameters/ID'
      responses:
        200:
          $ref: '#/components/responses/Survey'
        404:
          description: Survey not found
    put:
      tags:
        - Survey
      summary: Update a specific Survey
      parameters:
        - $ref: '#/components/parameters/ID'
      requestBody:
        $ref: '#/components/requestBodies/Survey'
      responses:
        200:
          $ref: '#/components/responses/Survey'
        404:
          description: Survey not found
    delete:
      tags:
        - Survey
      summary: Delete a specific Survey
      parameters:
        - $ref: '#/components/parameters/ID'
      responses:
        200:
          $ref: '#/components/responses/Status'
        404:
          description: Survey not found
  /surveys/{id}/attempts:
    get:
      tags:
        - Survey
      summary: Get survey attempts
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/Completed'
      responses:
        200:
          $ref: '#/components/responses/Attempts'
        404:
          description: Survey not found
    post:
      tags:
        - Survey
      summary: Start Attempt
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/Object_type'
      responses:
        200:
          $ref: '#/components/responses/StartAttempt'
        404:
          description: Error starting attempt
  /surveys/{id}/sections:
    get:
      tags:
        - Survey
      summary: Get survey sections
      parameters:
        - $ref: '#/components/parameters/ID'
      responses:
        200:
          $ref: '#/components/responses/Sections'
        404:
          description: Questions not found
    post:
      tags:
        - Survey
      summary: Create a new Section
      parameters:
        - $ref: '#/components/parameters/ID'
      requestBody:
        $ref: '#/components/requestBodies/Section'
      responses:
        200:
          description: The created Section
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Section'
  /surveys/{id}/sections/{section_id}:
    get:
      tags:
        - Survey
      summary: Get a specific section
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/Section'
        - $ref: '#/components/parameters/WithQuestions'
      responses:
        200:
          $ref: '#/components/responses/Section'
        404:
          description: Section not found
        500:
          description: Error updating section
    put:
      tags:
        - Survey
      summary: Update Section
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/Section'
      requestBody:
        $ref: '#/components/requestBodies/Section'
      responses:
        200:
          $ref: '#/components/responses/Section'
        404:
          description: Section not found
        500:
          description: Error updating section
    delete:
      tags:
        - Survey
      summary: Delete Section
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/Section'
      responses:
        200:
          $ref: '#/components/responses/Status'
        404:
          description: Section not found
        500:
          description: Error deleting section
  /surveys/{id}/sections/sort:
    post:
      tags:
        - Survey
      summary: Update the sort order of a Survey's Sections and Questions
      parameters:
        - $ref: '#/components/parameters/ID'
      requestBody:
        $ref: '#/components/requestBodies/SortOrder'
      responses:
        200:
          $ref: '#/components/responses/Status'
        404:
          description: Survey not found
        500:
          description: Order not updated
  /sections/{id}/questions:
    post:
      tags:
        - Survey
      summary: Create a new Question
      parameters:
        - $ref: '#/components/parameters/ID'
      requestBody:
        $ref: '#/components/requestBodies/Question'
      responses:
        200:
          description: The created Question
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Question'

  /sections/{id}/questions/{question_id}:
    get:
      tags:
        - Survey
      summary: Get specific question
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/Question'
      responses:
        200:
          $ref: '#/components/responses/Question'
        404:
          description: Question not found
    put:
      tags:
        - Survey
      summary: Update a Question
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/Question'
      requestBody:
        $ref: '#/components/requestBodies/Question'
      responses:
        200:
          description: The updated Question
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Question'
    delete:
      tags:
        - Survey
      summary: Unlink a Question
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/Question'
      responses:
        200:
          $ref: '#/components/responses/Status'

  # Polls
  /polls:
    get:
      tags:
        - Poll
      summary: Get polls
      responses:
        200:
          description: Get list of polls
          content:
            application/json:
              schema:
                type: object
                properties:
                  polls:
                    type: array
                    items:
                      {}
                  total:
                    type: integer
                    example: 12
        404:
          $ref: '#/components/responses/Poll404'
    post:
      tags:
        - Poll
      summary: Create a new poll
      requestBody:
        $ref: '#/components/requestBodies/Polls'
      responses:
        200:
          $ref: '#/components/responses/Poll'
        400:
          $ref: '#/components/responses/Poll400'
        404:
          $ref: '#/components/responses/Poll404'

  /polls/{id}:
    get:
      tags:
        - Poll
      summary: Get a specific poll
      parameters:
        - $ref: '#/components/parameters/ID'
      responses:
        200:
          $ref: '#/components/responses/Poll'
        404:
          $ref: '#/components/responses/Poll404'
    # edit poll
    put:
      tags:
        - Poll
      summary: Edit a specific poll
      parameters:
        - $ref: '#/components/parameters/ID'
      requestBody:
        $ref: '#/components/requestBodies/Polls'
      responses:
        200:
          $ref: '#/components/responses/Poll'
        404:
          $ref: '#/components/responses/Poll404'
    # delete poll
    delete:
      tags:
        - Poll
      summary: Remove a specific poll
      parameters:
        - $ref: '#/components/parameters/ID'
      responses:
        200:
          $ref: '#/components/responses/Status'
        404:
          $ref: '#/components/responses/Poll404'

  /polls/{id}/attempts:
    post:
      tags:
        - Poll
      summary: User start a new attempt
      parameters:
        - $ref: '#/components/parameters/ID'
      responses:
        200:
          $ref: '#/components/responses/Poll'
        404:
          $ref: '#/components/responses/Poll404'
    get:
      tags:
        - Poll
      summary: Get attempts for the poll
      parameters:
        - $ref: '#/components/parameters/ID'
      responses:
        200:
          $ref: '#/components/responses/Attempts'
        404:
          description: Poll not found

  /polls/{id}/result:
    get:
      tags:
        - Poll
      summary: User end a new poll
      parameters:
        - $ref: '#/components/parameters/ID'
      responses:
        200:
          $ref: '#/components/responses/Poll'
        404:
          $ref: '#/components/responses/Poll404'

  /polls/{id}/question:
    get:
      tags:
        - Poll
      summary: Get a question for poll
      parameters:
        - $ref: '#/components/parameters/ID'
      responses:
        200:
          $ref: '#/components/responses/Questions'
        404:
          $ref: '#/components/responses/Poll404'
    post:
      tags:
        - Poll
      summary: Create a new question for a poll
      parameters:
        - $ref: '#/components/parameters/ID'
      requestBody:
        $ref: '#/components/requestBodies/Question'
      responses:
        200:
          $ref: '#/components/responses/Question'
        404:
          $ref: '#/components/responses/Poll404'
    put:
      tags:
        - Poll
      summary: Update a question for a poll
      parameters:
        - $ref: '#/components/parameters/ID'
      requestBody:
        $ref: '#/components/requestBodies/Question'
      responses:
        200:
          $ref: '#/components/responses/Question'
        404:
          $ref: '#/components/responses/Poll404'
    delete:
      tags:
        - Poll
      summary: Unlink a question for a poll
      parameters:
        - $ref: '#/components/parameters/ID'
      responses:
        200:
          $ref: '#/components/responses/Status'
  /attemptables:
    get:
      tags:
        - Attemptable
      summary: Get survey attempts
      parameters:
          - $ref: '#/components/parameters/Type'
      responses:
        200:
          $ref: '#/components/responses/Attempts'
        404:
          description: Attemptables not found


# Reusable components
components:

  # Reusable parameters
  parameters:
    ID:
      name: id
      in: path
      required: true
      schema:
        type: integer
        minimum: 0
        default: 0
      description: Object ID
      example: 1
    Question:
      name: question_id
      in: path
      required: true
      schema:
        type: integer
        minimum: 0
        default: 0
      description: Question ID
      example: 1
    Section:
      name: section_id
      in: path
      required: true
      schema:
        type: integer
        minimum: 0
        default: 0
      description: Object ID
      example: 1
    WithQuestions:
      name: with_questions
      in: query
      required: false
      schema:
        type: integer
        minimum: 0
        maximum: 1
        default: 1
      description: Object ID
      example: test
    Completed:
      name: completed
      in: query
      required: false
      schema:
        type: integer
        minimum: 0
        maximum: 1
        default: 1
      description: Object ID
      example: test
    Type:
      name: type
      in: query
      required: false
      schema:
        type: integer
        minimum: 0
        maximum: 2
        default: 0
      description: Object ID
      example: test
    Object_type:
      name: object_type
      in: path
      required: true
      schema:
        type: integer
      description: Object type
      example: 1
    Query:
      name: query
      in: query
      schema:
        type: string
      description: Query string
    Limit:
      name: limit
      in: query
      schema:
        type: integer
        minimum: 1
        maximum: 200
        default: 20
      description: The number of items to return.
    Offset:
      name: offset
      in: query
      schema:
        type: integer
      description: The number of items to offset results by.

  # Reusable request bodies
  requestBodies:
    SortOrder:
      description: Sort Order
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SortObject'
    UpdateAttempt:
      description: Update Attempt
      content:
        application/json:
          schema:
            type: object
            properties:
              complete:
                type: boolean
              options:
                $ref: '#/components/schemas/Options'
              question_id:
                type: integer
              submitted:
                type: boolean
              time_taken:
                type: integer
    Answers:
      description: Answer a number of questions
      content:
        application/json:
          schema:
            type: array
            items:
              $ref: '#/components/schemas/AnswerQuestion'
    Survey:
      description: The Survey to persist
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Survey'

    Polls:
      description: Poll request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Poll'

    Section:
      description: The Section to persist
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Section'

    Question:
      description: The Question to persist
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Question'

  # Reusable responses
  responses:
    Quiz:
      description: The matching Quiz
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: integer
              quiz:
                $ref: '#/components/schemas/Quiz'
              attempt:
                $ref: '#/components/schemas/Attempt'
              max_score:
                type: integer
              pass_mark:
                type: integer
              attempts_left:
                type: integer
              question_count:
                type: integer
              attempts_count:
                type: integer
              permissions:
                $ref: '#/components/schemas/Permissions'
    Questions:
      description: The questions of an object type
      content:
        application/json:
          schema:
            type: object
            properties:
              questions:
                type: array
                items:
                  $ref: '#/components/schemas/Question'
              status:
                type: integer
              pagination:
                $ref: '#/components/schemas/Pagination'
    Attempts:
      description: The object type incomplete attempt response
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: integer
              attempts:
                type: array
                items:
                  $ref: '#/components/schemas/Attempt'
              total:
                type: integer
              pagination:
                $ref: '#/components/schemas/Pagination'
    Quizzes:
      description: List of Quiz objects
      content:
        application/json:
          schema:
            type: object
            properties:
              quizzes:
                type: array
                items:
                  $ref: '#/components/schemas/Quiz'
              total:
                type: integer
              pagination:
                $ref: '#/components/schemas/Pagination'
    Surveys:
      description: List of survey objects
      content:
        application/json:
          schema:
            type: object
            properties:
              surveys:
                type: array
                items:
                  $ref: '#/components/schemas/Survey'
              total:
                type: integer
              pagination:
                $ref: '#/components/schemas/Pagination'
    Sections:
      description: List of section objects
      content:
        application/json:
          schema:
            type: object
            properties:
              surveys:
                type: array
                items:
                  $ref: '#/components/schemas/Section'
              total:
                type: integer
              pagination:
                $ref: '#/components/schemas/Pagination'
    StartAttempt:
      description: Start attempt response
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: integer
                example: 1
              attempt:
                $ref: '#/components/schemas/Attempt'
              answers:
                type: array
                items:
                  $ref: '#/components/schemas/Answer'
              questions:
                type: array
                items:
                  $ref: '#/components/schemas/Question'
              showHelpText:
                type: integer
              shuffleOptions:
                type: boolean
    UpdateAttempt:
      description: The result of an update
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: integer
                example: 1
              results:
                type: object
                properties:
                  passed:
                    type: boolean
                    example: true
                  user_points:
                    type: integer
                    example: 10
                  quiz_points:
                    type: integer
                    example: 10
                  max_points:
                    type: integer
                    example: 20
                  quiz_percent:
                    type: integer
                    example: 40
                  time_taken:
                    type: integer
                    example: 2000
                  date_completed:
                    type: string
                  show_help_text:
                    type: integer
                    example: 1
                  show_results:
                    type: integer
                    example: 1
              attempt_id:
                type: integer
                example: 1
              answers:
                type: array
                items:
                  $ref: '#/components/schemas/Answer'
              can_retake:
                type: boolean
                example: true
    Status:
      description: The response status
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: integer
                example: 1
    Survey:
      description: The matching Survey
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: integer
              survey:
                $ref: '#/components/schemas/Survey'
              attempt:
                $ref: '#/components/schemas/Attempt'
              attempts_left:
                type: integer
              question_count:
                type: integer
              attempts_count:
                type: integer
              permissions:
                $ref: '#/components/schemas/Permissions'
    Section:
      description: The Matching Section
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Section'
    Question:
      description: The Matching Question
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Question'
    Poll:
      description: The poll object
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: integer
                description: Poll status
                example: 1
              poll:
                $ref: '#/components/schemas/Poll'
              permissions:
                $ref: '#/components/schemas/Permissions'
    Poll400:
      description: Return an object when input data is invalid
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Poll400'
    Poll404:
      description: Return an object when a poll was not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Poll404'

  # Object types
  schemas:
    Quiz:
      type: object
      description: Quiz object
      required:
        - title
        - description
      properties:
        id:
          type: integer
          example: 335
          readOnly: true
        title:
          type: string
          example: New Quiz
        description:
          type: string
          example: Quiz description
        image_url:
          type: string
          example: Smith
        created_by:
          type: object
          properties:
            name:
              type: string
            url:
              type: string
        created_date:
          type: string
          description: The date the Quiz was created
          format: date-time
          readOnly: true
        status:
          type: boolean
          example: 1
        is_draft:
          type: boolean
          example: 1
        is_live:
          type: boolean
          example: 1
        is_archived:
          type: boolean
          example: 1
        questions:
          type: array
          items:
            $ref: '#/components/schemas/Question'
    Question:
      type: object
      properties:
        id:
          type: integer
          example: 335
          readOnly: true
        text:
          type: string
          example: New Question
        description:
          type: string
          example: Question description
        type:
          type: integer
          example: 1
        image_url:
          type: string
          example: Smith
        created_by:
          type: object
          properties:
            name:
              type: string
            url:
              type: string
        created_date:
          type: string
          description: The date the Quiz was created
          format: date-time
          readOnly: true
        options:
          type: array
          items:
            $ref: '#/components/schemas/Option'
        correct_options_count:
          type: integer
          example: 1
        helper_descriptions:
          type: string
          example: "Choose a single correct answer"
        img:
          type: string
          example: "file_2.jpg"
    Option:
      type: object
      properties:
        id:
          type: integer
          example: 3
        type:
          type: integer
          example: 1
        text:
          type: string
          example: "object 2"
        sort_order:
          type: integer
          example: 2
        created_by:
          type: object
          properties:
            name:
              type: string
            url:
              type: string
    Section:
      type: object
      properties:
        id:
          type: integer
          example: 3
        survey_id:
          type: integer
          example: 1
        title:
          type: string
          example: "Section 2"
    Attempt:
      type: object
      properties:
        id:
          type: integer
          example: 1
        user_id:
          type: integer
          example: 1
        user:
          type: object
          properties:
            name:
              type: string
              example: James
            url:
              type: string
              example: "/people/user/73928435"
            photo_url:
              type: string
              example: "appdata/people/24_large.jpg"
        attempt:
          type: integer
          example: 1
          description: the attempt number
        created_date:
          type: string
          description: The date the attempt was created
          format: date-time
        completed_date:
          type: string
          description: The date the attempt was completed
          format: date-time
        last_access_date:
          type: string
          description: The date the attempt was last accessed
          format: date-time
        properties:
          $ref: '#/components/schemas/ObjectProperty'
    ObjectProperty:
      type: object
      additionalProperties:
        type: string
    SortObject:
      type: object
      additionalProperties:
        type: integer
    Options:
      type: object
      additionalProperties:
        type: integer
    Permissions:
      type: object
      properties:
        can_preview:
          type: boolean
          example: true
        can_attempt:
          type: boolean
        can_manage:
          type: boolean
        can_view_status:
          type: boolean
        can_view_statistics:
          type: boolean
    Answer:
      type: object
      properties:
        id:
          type: integer
          example: 1
        attempt_id:
          type: integer
          example: 1
        question_id:
          type: integer
          example: 1
        created_date:
          type: string
          description: The date the answer was created
          format: date-time
        properties:
          $ref: '#/components/schemas/ObjectProperty'
    AnswerQuestion:
      type: object
      description: Submit Question
      properties:
        question_id:
          type: integer
        submitted:
          type: boolean
        options:
          $ref: '#/components/schemas/Options'
        time_taken:
          type: integer
    Survey:
      type: object
      description: Survey object
      required:
        - title
        - description
      properties:
        id:
          type: integer
          example: 335
          readOnly: true
        title:
          type: string
          example: New Quiz
        description:
          type: string
          example: Quiz description
        image_url:
          type: string
          example: Smith
        created_by:
          type: object
          properties:
            name:
              type: string
            url:
              type: string
        created_date:
          type: string
          description: The date the Survey was created
          format: date-time
          readOnly: true
        status:
          type: boolean
          example: 1
        is_draft:
          type: boolean
          example: 1
        is_live:
          type: boolean
          example: 1
        is_archived:
          type: boolean
          example: 1
        notification:
          type: boolean
          description: Set survey's notification
          example: 0
        questions:
          type: array
          items:
            $ref: '#/components/schemas/Question'
    Pagination:
      type: object
      properties:
        offset:
          type: integer
          description: The number of items results are offset by
          example: 0
          readOnly: true
        limit:
          type: integer
          description: The number of items returned
          example: 20
          readOnly: true
        total:
          type: integer
          description: The total number of items
          example: 100
          readOnly: true
        prev:
          type: string
          nullable: true
          description: URL to the previous page of items
          example: null
          readOnly: true
        next:
          type: string
          nullable: true
          description: URL to the next page of items
          example: null
          readOnly: true
    Poll:
      type: object
      properties:
        id:
          type: integer
          description: Poll ID
          example: 1
          readOnly: true
        start_date:
          type: string
          description: The date when the poll will be available
          format: date-time
          example: "2019-09-11T08:36:45.038Z"
        end_date:
          type: string
          description: The date on end of the poll
          format: date-time
          example: "2019-09-13T08:36:45.038Z"
        description:
          type: string
          description: Name/description of the poll
          example: Some example description
        anonymous:
          type: boolean
          description: The poll is anonymous
        multiple_submissions:
          type: boolean
          description: Allow multiple submissions
        show_result:
          type: integer
          description: Show poll result
        copy_result_to_email:
          type: boolean
          description: Send an email with poll's result
        status:
          type: integer
          description: Poll status Draft/Live/Archived
        completion_message:
          type: string
          description: Message to show on completion
          example: 'Thank you for answering the poll'
        question:
          type: array
          description: array contains question for poll
          items:
            $ref: '#/components/schemas/Question'
        notification:
          type: boolean
          description: Set poll's notification 
          example: 0
        notify_on_submit:
          type: boolean
          default: false
          description: Send a notification when poll is created
          example: false
    Poll400:
      type: object
      properties:
        error:
          type: boolean
          description: Error flag
        message:
          type: string
          description: Error message
          example: "field 'options' is invalid"
        code:
          type: integer
          description: Return the code error
          example: 400
    Poll404:
      type: object
      properties:
        error:
          type: boolean
          description: is error flag
        message:
          type: string
          description: Error message
          example: 'Poll does not exist'
        code:
          type: integer
          description: Return the code error
          example: 404

  securitySchemes:
    HttpBasic:
      type: http
      scheme: basic
