-
Notifications
You must be signed in to change notification settings - Fork 1
API
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.
Retrieve all the faculties in the University of Porto.
faculty/
{
model: "university.faculty",
pk: number,
fields: {
acronym: string,
name: string,
last_updated: timestamp
}
}
{
"model": "university.faculty",
"pk": 1,
"fields": {
"acronym": "faup",
"name": "Página da Faculdade de Arquitectura",
"last_updated": "2022-02-19T14:41:13Z"
}
course/
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
}
{
"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"
}
This API returns all the curricular units for a given course in a semester.
course_units/<int:course_id>/<int:semester>/
-
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).
{
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
}
}
{
"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"
}
}
Retrieves the schedules of a course.
schedule/<int:course_unit_id>
-
course_unit_id
- id of the course in the database.
{
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
}
}
{
"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
}
}