openapi: 3.0.2
info:
  description: Resultservice External API
  version: "0.1.0"
  title: Resultservice External API
servers:
  - url: 'https://{subdomain}.smartschool.be/Api/Resultservice'
security:
  - OAuthClientCredentials: [ exerciseresults ]
paths:
  /resultservice:
    post:
      summary: Send results of one or more evaluation
      operationId: result_ship_results
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/Assignment'
      responses:
        '200':
          description: OK
      tags:
        - assignments

components:
  schemas:
    Assignment:
      type: object
      properties:
        uuid:
          type: string
          description: Unique partner reference of the assignment, should be the same value for each transfer of the same assignment.
        teacher:
          type: string
          description: Identifier of the teacher (Smartschool identifier).
        title:
          type: string
          description: Title of the assignment.
          example: 'Assignment 1'
        date:
          type: string
          description: Date of the assignment.
          example: '2023-11-24'
        maximum:
          type: integer
          description: Maximum of the assignment.
          example: 10
        class:
          type: string
          description: Class of the assignment (not used at this time).
          example: '1A1'
        course:
          type: string
          description: Course of the assignment (not used at this time).
          example: 'Mathematics'
        description:
          type: string
          description: Description of the assignment (not used at this time).
          example: 'In this assignment we will learn how to add numbers.'
        results:
          type: array
          items:
            $ref: '#/components/schemas/Result'
      required:
        - uuid
        - teacher
        - title
        - date
        - maximum
        - results
    Result:
      type: object
      properties:
        student:
          type: string
          description: Identifier of the student (Smartschool identifier).
        result:
          type: integer
          description: Integer result value.
          example: 7
        comment:
          type: string
          description: Comment of the result (not used at this time).
          example: 'Well done, keep it up.'
        date:
          type: string
          description: Date of the result.
          example: '2023-11-24 11:05:00'
      required:
        - student
        - result
        - date
  securitySchemes:
    OAuthClientCredentials:
      type: oauth2
      description: '[More info](https://www.smartschool.be/developers/)'
      flows:
        clientCredentials:
          tokenUrl: https://dummy.smartschool.be/OAuth/index/token
          scopes:
            exerciseresults: use the resultservice external api