Politecnico di Torino Offering API

The Offering API from Politecnico di Torino — 4 operation(s) for offering.

OpenAPI Specification

politecnico-di-torino-offering-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: Polito Faculty Announcements Offering API
  version: 0.0.1
  license:
    name: CC BY-NC 4.0
    url: https://creativecommons.org/licenses/by-nc/4.0/
servers:
- url: https://app.didattica.polito.it/api
  description: Production server
  variables: {}
- url: https://app.didattica.polito.it/mock/api
  description: Mock server (uses example data)
  variables: {}
security:
- BearerAuth: []
tags:
- name: Offering
paths:
  /offering:
    get:
      operationId: Offering_getOffering
      summary: Get offering | Mostra offerta formativa
      parameters: []
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/OfferingResponse'
                required:
                - data
        '400':
          description: The server could not understand the request due to invalid syntax.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      tags:
      - Offering
  /offering/courses/{courseShortcode}:
    get:
      operationId: Offering_getOfferingCourse
      summary: Show offering course | Mostra corso dell'offerta formativa
      parameters:
      - name: courseShortcode
        in: path
        required: true
        schema:
          type: string
      - name: year
        in: query
        required: false
        schema:
          type: string
        explode: false
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/OfferingCourse'
                required:
                - data
        '400':
          description: The server could not understand the request due to invalid syntax.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      tags:
      - Offering
  /offering/courses/{courseShortcode}/statistics:
    get:
      operationId: Offering_getCourseStatistics
      summary: Retrieve course statistics | Recupera le statistiche dell'insegnamento
      parameters:
      - name: courseShortcode
        in: path
        required: true
        schema:
          type: string
      - name: year
        in: query
        required: false
        schema:
          type: string
        explode: false
      - name: teacherId
        in: query
        required: false
        schema:
          type: string
        explode: false
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/CourseStatistics'
                required:
                - data
        '400':
          description: The server could not understand the request due to invalid syntax.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      tags:
      - Offering
  /offering/degrees/{degreeId}:
    get:
      operationId: Offering_getOfferingDegree
      summary: Show a degree | Mostra un corso di laurea
      parameters:
      - name: degreeId
        in: path
        required: true
        schema:
          type: string
      - name: year
        in: query
        required: false
        schema:
          type: string
        explode: false
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Degree'
                required:
                - data
        '400':
          description: The server could not understand the request due to invalid syntax.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      tags:
      - Offering
components:
  schemas:
    DegreeOverview:
      type: object
      required:
      - id
      - name
      properties:
        id:
          type: string
          example: 81-6
        name:
          type: string
          example: Design e comunicazione
      example:
        id: 81-6
        name: Design e comunicazione
    GradeCount:
      type: object
      required:
      - grade
      - count
      properties:
        grade:
          type: string
          enum:
          - '18'
          - '19'
          - '20'
          - '21'
          - '22'
          - '23'
          - '24'
          - '25'
          - '26'
          - '27'
          - '28'
          - '29'
          - '30'
          - 30L
        count:
          type: integer
    Teacher:
      type: object
      required:
      - id
      - firstName
      - lastName
      properties:
        id:
          type: integer
        firstName:
          type: string
        lastName:
          type: string
    Degree:
      type: object
      required:
      - id
      - name
      - level
      - department
      - faculty
      - location
      - duration
      - class
      - year
      - editions
      - notes
      - objectives
      - jobOpportunities
      - tracks
      properties:
        id:
          type: string
          example: 81-6
        name:
          type: string
          example: Design e comunicazione
        level:
          type: string
        department:
          type: object
          properties:
            name:
              type: string
          required:
          - name
        faculty:
          type: object
          properties:
            id:
              type: string
            name:
              type: string
        location:
          type: string
        duration:
          type: string
        class:
          type: object
          properties:
            code:
              type: string
            name:
              type: string
          required:
          - code
          - name
        year:
          type: number
        editions:
          type: array
          items:
            type: string
          description: All the available editions of this degree
        notes:
          type: array
          items:
            type: string
          example:
          - Corso tenuto in italiano
        objectives:
          type: object
          properties:
            title:
              type: string
              example: Obiettivi formativi
            content:
              type: string
          required:
          - title
          - content
        jobOpportunities:
          type: object
          properties:
            title:
              type: string
            content:
              type: string
          required:
          - title
          - content
        tracks:
          type: array
          items:
            $ref: '#/components/schemas/Track'
    CourseHours:
      type: object
      properties:
        lecture:
          type: integer
        tutoring:
          type: integer
        classroomExercise:
          type: integer
        labExercise:
          type: integer
    OfferingClass:
      type: object
      required:
      - name
      - code
      - degrees
      properties:
        name:
          type: string
          example: Disegno industriale
        code:
          type: string
          example: L-4
        degrees:
          type: array
          items:
            $ref: '#/components/schemas/DegreeOverview'
      example:
        name: Disegno industriale
        code: L-4
        degrees:
        - id: 81-6
          name: Design e comunicazione
    CourseStatistics:
      type: object
      required:
      - shortcode
      - year
      - teacher
      - totalEnrolled
      - totalSucceeded
      - totalFailed
      - firstYear
      - otherYears
      - previousYearsToCompare
      - years
      - teachers
      properties:
        shortcode:
          type: string
        year:
          type: integer
        teacher:
          $ref: '#/components/schemas/Teacher'
        totalEnrolled:
          type: integer
        totalSucceeded:
          type: integer
        totalFailed:
          type: integer
        firstYear:
          $ref: '#/components/schemas/YearStatistics'
        otherYears:
          $ref: '#/components/schemas/YearStatistics'
        previousYearsToCompare:
          type: array
          items:
            $ref: '#/components/schemas/PreviousYearsToCompare'
        years:
          type: array
          items:
            type: integer
        teachers:
          type: array
          items:
            $ref: '#/components/schemas/Teacher'
    OfferingCourseOverview:
      type: object
      required:
      - name
      - shortcode
      - cfu
      - teachingYear
      - language
      - group
      properties:
        name:
          type: string
          example: System and device programming
        shortcode:
          type: string
          example: 01NYHOV
        cfu:
          type: integer
          example: 10
        teachingYear:
          type: integer
          description: The year this course belongs to in this degree
          example: 1
        language:
          type: string
          enum:
          - it
          - en
          example: en
        group:
          type: string
          nullable: true
          example: Insegnamento a scelta 1
      example:
        name: System and device programming
        shortcode: 01NYHOV
        cfu: 10
        teachingYear: 1
        language: en
        group: Insegnamento a scelta 1
    OfferingCourse:
      type: object
      required:
      - name
      - shortcode
      - cfu
      - teachingPeriod
      - languages
      - year
      - hours
      - editions
      - staff
      - guide
      properties:
        name:
          type: string
        shortcode:
          type: string
        cfu:
          type: integer
        teachingPeriod:
          type: string
          description: The semester(s) this course belongs to
        languages:
          type: array
          items:
            type: string
            enum:
            - it
            - en
        year:
          type: string
        hours:
          $ref: '#/components/schemas/CourseHours'
        editions:
          type: array
          items:
            type: string
          description: All the available editions of this course
        staff:
          type: array
          items:
            $ref: '#/components/schemas/OfferingCourseStaff'
        guide:
          type: array
          items:
            $ref: '#/components/schemas/GuideSection'
    YearStatistics:
      type: object
      required:
      - succeeded
      - failed
      - grades
      - averageGrade
      properties:
        succeeded:
          type: integer
        failed:
          type: integer
        grades:
          type: array
          items:
            $ref: '#/components/schemas/GradeCount'
        averageGrade:
          type: number
          nullable: true
    GuideSection:
      type: object
      required:
      - title
      - content
      properties:
        title:
          type: string
          example: Title
        content:
          type: string
          example: HTML content
    ErrorResponse:
      type: object
      properties:
        code:
          type: integer
        message:
          type: string
    Track:
      type: object
      required:
      - id
      - name
      - courses
      properties:
        id:
          type: number
          example: 2060
        name:
          type: string
          example: Design per la comunicazione
        courses:
          type: array
          items:
            $ref: '#/components/schemas/OfferingCourseOverview'
      example:
        id: 2060
        name: Design per la comunicazione
        courses:
        - name: System and device programming
          shortcode: 01NYHOV
          cfu: 10
          teachingYear: 1
          language: en
          group: Insegnamento a scelta 1
    OfferingResponse:
      type: object
      properties:
        bachelor:
          type: array
          items:
            $ref: '#/components/schemas/OfferingClass'
        master:
          type: array
          items:
            $ref: '#/components/schemas/OfferingClass'
    PreviousYearsToCompare:
      type: object
      required:
      - year
      - succeeded
      - failed
      properties:
        year:
          type: integer
        succeeded:
          type: integer
        failed:
          type: integer
    OfferingCourseStaff:
      type: object
      required:
      - role
      - id
      - courseId
      properties:
        role:
          type: string
        id:
          type: number
        courseId:
          type: number
  securitySchemes:
    BearerAuth:
      type: http
      scheme: Bearer