---
# System prepended metadata

title: API Módulo de horários
tags: [ModuloEscolhaHorarios]

---

---
tags: ModuloEscolhaHorarios
---
 
# API Módulo de horários
# Índice

[TOC]

# Endpoints

## GET /UCS?registrationId
### Request
**registrationId** as query parameter.
### Response
```
{
   "ucs":{
      "normal":[
         {
            "typologies":[
               {
                  "OT":"Orientação tutorial"
               },
               {
                  "TP":"Teórico Prática"
               }
            ],
            "name":"UAU",
            "color":"#FF",
            "initials":"P1",
            "uc_id":1,
            "total_choices":1,
            "ects":12,
            "classes":[
               {
                  "class_id":1,
                  "uc_id":1,
                  "period":1,
                  "start_hour":1,
                  "end_hour":1,
                  "day":1,
                  "room":"teste",
                  "type":"TP",
                  "number":"TP1",
                  "color":"#FFF",
                  "allocated":{
                     "state":"colocado",
                     "previous_tries":[
                        1,
                        2,
                        3
                     ]
                  },
                  "weeks":[
                     {
                        "weeks_id":1,
                        "date":"1/12/2020"
                     },
                     {
                        "weeks_id":2,
                        "date":"8/12/2020"
                     }
                  ],
                  "pre_selected":true,
                  "slots":60,
                  "associated_classes":[
                     1,
                     2,
                     3
                  ]
               }
            ]
         }
      ],
      "mandatory":[
         {
            "name":"UAU",
            "mandatory_group_id":2,
            "ucs":[
               {
                  "typologies":[
                     {
                        "OT":"Orientação tutorial"
                     },
                     {
                        "TP":"Teórico Prática"
                     }
                  ],
                  "name":"TP25",
                  "color":"#FF",
                  "initials":"P1",
                  "uc_id":1,
                  "total_choices":1,
                  "ects":12,
                  "classes":[
                     {
                        "class_id":1,
                        "uc_id":1,
                        "period":1,
                        "start_hour":1,
                        "end_hour":1,
                        "day":1,
                        "room":"teste",
                        "type":"TP",
                        "number":"TP1",
                        "color":"#FFF",
                        "allocated":{
                           "state":"colocado",
                           "previous_tries":[
                              1,
                              2,
                              3
                           ]
                        },
                        "weeks":[
                           {
                              "weeks_id":1,
                              "date":"1/12/2020"
                           },
                           {
                              "weeks_id":2,
                              "date":"8/12/2020"
                           }
                        ],
                        "pre_selected":true,
                        "slots":60,
                        "associated_classes":[
                           1,
                           2,
                           3
                        ]
                     }
                  ]
               }
            ]
         }
      ]
   },
   "weeks":[
      {
         "id":1,
         "start_date":"1/12/2020",
         "end_date":"7/12/2020"
      },
      {
         "id":2,
         "start_date":"8/12/2020",
         "end_date":"15/12/2020"
      }
   ],
   "schedules":1
}
```


## GET /Seriation?registrationId
### Request
**registrationId** as query parameter.
### Response
```
{
   "seriation_id":"1",
   "registration_id":1,
   "has_schedule":false,
   "is_final":false,
   "timestamp":"1/12/2020 18:37:15",
   "classes":[
      {
         "class_id":1,
         "uc_id":1,
         "uc_name":"TP1", HERE
         "ser_tries":[
            {
               "class_id":1, HERE
               "name":"teste",
               "total_slots":10,
               "free_slots_student":10,
               "occupied_slots_student":0,
               "timestamp":"1/12/2020 18:37:15"
            }
         ],
         "free_slots_student":1,
         "occupied_slots_student":1,
         "number_selects":1,
         "lower_ranking":12,
         "higher_ranking":15,
         "allocation_status":"likely",
         "placed":true,
         "phase":1,
         "timestamp":"1/12/2020 18:37:15",
         "number":"1", HERE
         "type":"TP" HERE
      }
   ]
}
```

## POST /Schedules
### Request
```
{
   "registration_id":1,
   "name":"horario teste",
   "classes":[
      {
         "class_id":1,
         "uc_id":1,
         "mandatory_group_id":1,
      }
   ]
}
```
### Response
Status code as response.


## GET /Schedules{schedule_id}?registrationId
### Request
**schedule_id** as part of the URL.
**registrationId** as query parameter.
### Response
```
{
   "phase":1,
   "year":2020,
   "period":1,
   "schedule_id":1,
   "preference":1,
   "name":false,
   "weeks":"1,3,5,7,9",
   "classes":[
      {
         "class_id":1,
         "uc_id":1,
         "mandatory_group_id":1,
         "period":1,
         "start_hour":1,
         "end_hour":1,
         "day":1,
         "room":"teste",
         "type":"TP",
         "number":"TP1",
         "color":"#FFF",
         "allocated":true,
         "pre_selected":true,
         "slots":60,
         "associated_classes":[
            1,
            2,
            3
         ]
      }
   ]
}
```

## GET /Schedules?registrationId
### Request
**registrationId** as query parameter.
### Response
```
[
   {
      "phase":1,
      "year":2020,
      "period":1,
      "schedule_id":1,
      "preference":1,
      "name":false,
      "weeks":"1,3,5,7,9",
      "classes":[
         {
            "class_id":1,
            "uc_id":1,
            "mandatory_group_id":1,
            "period":1,
            "start_hour":1,
            "end_hour":1,
            "day":1,
            "room":"teste",
            "type":"TP",
            "number":"TP1",
            "color":"#FFF",
            "allocated":true,
            "pre_selected":true,
            "slots":60,
            "associated_classes":[
               1,
               2,
               3
            ]
         }
      ]
   }
]
```

## GET /Schedules?registrationId
### Request
**registrationId** as query parameter.
### Response
```
[
   {
      "phase":1,
      "year":2020,
      "period":1,
      "schedule_id":1,
      "preference":1,
      "name":false,
      "weeks":"1,3,5,7,9",
      "classes":[
         {
            "class_id":1,
            "uc_id":1,
            "mandatory_group_id":1,
            "period":1,
            "start_hour":1,
            "end_hour":1,
            "day":1,
            "room":"teste",
            "type":"TP",
            "number":"TP1",
            "color":"#FFF",
            "allocated":true,
            "pre_selected":true,
            "slots":60,
            "associated_classes":[
               1,
               2,
               3
            ]
         }
      ]
   }
]
```

## GET /Schedule?registrationId HERE
### Request
**registrationId** as query parameter.
### Response
```
[
   {
      "phase":1,
      "year":2020,
      "period":1,
      "schedule_id":1,
      "preference":1,
      "name":false,
      "weeks":"1,3,5,7,9",
      "classes":[
         {
            "class_id":1,
            "uc_id":1,
            "mandatory_group_id":1,
            "period":1,
            "start_hour":1,
            "end_hour":1,
            "day":1,
            "room":"teste",
            "type":"TP",
            "number":"TP1",
            "color":"#FFF",
            "allocated":true,
            "pre_selected":true,
            "slots":60,
            "associated_classes":[
               1,
               2,
               3
            ]
         }
      ]
   }
]
```

## GET /Schedule?registrationId HERE
### Request
**registrationId** as query parameter.
### Response
```
[
   {
      "phase":1,
      "year":2020,
      "period":1,
      "schedule_id":1,
      "preference":1,
      "name":false,
      "weeks":"1,3,5,7,9",
      "classes":[
         {
            "class_id":1,
            "uc_id":1,
            "mandatory_group_id":1,
            "period":1,
            "start_hour":1,
            "end_hour":1,
            "day":1,
            "room":"teste",
            "type":"TP",
            "number":"TP1",
            "color":"#FFF",
            "allocated":true,
            "pre_selected":true,
            "slots":60,
            "associated_classes":[
               1,
               2,
               3
            ]
         }
      ]
   }
]
```

## DELETE /Schedule
### Request
```
{
   "schedule_id":1,
   "registration_id":1
}
```

### Response
Status code as response.