Skip to content
Juliane Marubayashi edited this page Mar 1, 2022 · 5 revisions

The backend offers four services:

  • Retrieve all the faculties
  • Retrieve all the courses
  • Retrieve all the units of a given course
  • Retrieve all the schedules of a given unit

The following sections describes the api's documents and how to perform requests.

Faculty

Retrieve all the faculties in the University of Porto.

Request

faculty/

Document

{
  model: "university.faculty",
  pk: number,
  fields: {
    acronym: string,
    name: string,
    last_updated: timestamp
  }
} 

Example

  {
    "model": "university.faculty",
    "pk": 1,
    "fields": {
      "acronym": "faup",
      "name": "Página da Faculdade de Arquitectura",
      "last_updated": "2022-02-19T14:41:13Z"
    }
}

Course

Request

course/

Document

  model: "university.course", 
  pk: number,
  fields: {
    course_id: number,  # id in sigarra
    faculty: number,    # faculty id in the database
    name: string,
    acronym: string,
    course_type: string,
    year: number,
    url: string,
    plan_url: string,
    last_updated: string
  } 

Example

  {
    "model": "university.course",
    "pk": 1,
    "fields": {
      "course_id": 853,
      "faculty": 5,
      "name": "2º Ciclo em Ensino de Educação Física nos Ensinos Básico e Secundário",
      "acronym": "EEFEBS",
      "course_type": "M",
      "year": 2021,
      "url": "https://sigarra.up.pt/fadeup/pt/cur_geral.cur_view?pv_ano_lectivo=2021&pv_origem=CUR&pv_tipo_cur_sigla=M&pv_curso_id=853",
      "plan_url": "https://sigarra.up.pt/fadeup/pt/cur_geral.cur_planos_estudos_view?pv_plano_id=14261&pv_ano_lectivo=2021&pv_tipo_cur_sigla=M&pv_origem=CUR",
      "last_updated": "2022-02-19T14:41:34Z"
    }

Curricular units

This API returns all the curricular units for a given course in a semester.

Request

course_units/<int:course_id>/<int:semester>/

Parameters

  • course_id: id of the course in the database. Notice that this is not the id in sigarra.
  • semester: number of the semester (i.e 1 or 2).

Document

{
  model: "university.courseunit",
  pk: 170,
  fields: {
    course_unit_id: number,
    course: number,
    name: string,
    acronym: string,
    url: string,
    course_year: number,
    year: number,
    schedule_url: string,
    last_updated: string
  }
}

Example

 {
    "model": "university.courseunit",
    "pk": 170,
    "fields": {
      "course_unit_id": 489964,
      "course": 23,
      "name": "Introdução à Topologia",
      "acronym": "M3008",
      "url": "https://sigarra.up.pt/fcup/pt/ucurr_geral.ficha_uc_view?pv_ocorrencia_id=489964",
      "course_year": 3,
      "semester": 1,
      "year": 2021,
      "schedule_url": "https://sigarra.up.pt/fcup/pt/hor_geral.ucurr_view?pv_ocorrencia_id=489964 ",
      "last_updated": "2022-02-19T14:43:27Z"
    }
  }

Schedule

Retrieves the schedules of a course.

Request

schedule/<int:course_unit_id>

Parameters

  • course_unit_id - id of the course in the database.

Document

{
  model: "university.schedule",
  pk: number, 
  fields: {
    day: number, 
    duration: string, 
    start_time: string, 
    location: string, 
    lesson_type: string, # e.g T, TP, P
    teacher_acronym: string,  
    course_unit: number, # identification of course_unit in database
    last_updated: string, 
    class_name: string, 
    composed_class_name: string  # can be null 
  }
}

Example

  {
    "model": "university.schedule",
    "pk": 132,
    "fields": {
      "day": 4,
      "duration": "4.0",
      "start_time": "9.0",
      "location": "FCNAUP 0.302",
      "lesson_type": "T",
      "teacher_acronym": "MMMSM",
      "course_unit": 1,
      "last_updated": "2022-02-19T14:46:51Z",
      "class_name": "MAC",
      "composed_class_name": null
    }
}
Clone this wiki locally