Home | Escopo e Cronograma | Processo | Design/Mockups | Configuração | Arquitetura | Código | BD | Qualidade | Utilização | Contratos |
---|
Contratos de comunicação back-front
GET /students/
Params:
Nenhum parâmetro esperado
Query string:
- institution: str = faculdade do aluno
- semester: int = semestre em que o aluno se encontra
- offset: str = início da lista de professores
- limit: str = tamanho da lista retornada
Payload:
Nenhum payload esperado
Responses:
- 200
{ status: 200, msg: "Success", students: [ { id: 11, name: "str", birthday: "11/06/1999", email: "str", semester: 5, description: "str", lattersURL: "str", course: { name:"str" }, institution: { name: "str" } }, ... ] }
- 400
{ status: 400, msg: "Bad request", errors: [ { value: "", msg: "Invalid value for \"semester\"" } ] }
- 500
{ status: 500, msg: "Internal error occurred", errors: Any }
GET /students/{id}/
Params:
- id: int = id do estudante
Query string:
Nenhuma query string esperada
Payload:
Nenhum payload esperado
Responses:
- 200
{ status: 200, msg: "Success", student: { id: 11, name: "str", birthday: "11/06/1999", email: "str", semester: 5, description: "str", lattersURL: "str", course: { name:"str" }, gender: { name: "str" }, institution: { name: "str" } } }
- 400
{ status: 400, msg: "Bad request", errors: [ { value: "", msg: "Invalid value for \"id\"" } ] }
- 404
{ status: 404, msg: "Bad request", errors: [ { value: 10, msg: "Student not found with id=10" } ] }
- 500
{ status: 500, msg: "Internal error occurred", errors: Any }
POST /students/
Params:
Nenhum parâmetro esperado
Query string:
Nenhuma query string esperada
Payload:
{
student: {
name: "str",
birthday: "11/06/1999",
email: "str",
semester: 5,
course: "str",
gender: "str",
institution: "str",
password: "str"
}
}
Responses:
- 201:
{ status: 201, msg: "Success", student: { id: 1, name: "str", birthday: "11/06/1999", email: "str", semester: 5, course: { name:"str" }, gender: { name: "str" }, institution: { name: "str" } } }
- 400:
{ status: 400, msg: "Bad request", errors: [ { value: "joao.severo", msg: "Invalid value for \"email\"" } ] }
- 404
{ status: 404, msg: "Bad request", errors: [ { value: 10, msg: "Student not found with id=10" } ] }
- 500
{ status: 500, msg: "Internal error occurred", errors: Any }
PUT /students/{id}/
Params:
- id: int = id do aluno a atualizar dados
Query string:
Nenhuma query string esperada
Payload:
{
student: {
name: "str",
birthday: "11/06/1999",
email: "str",
semester: 5,
course: "str",
gender: "str",
institution: "str",
}
}
Responses
-
204: NO_CONTENT
-
400:
{ status: 400, msg: "Bad request", errors: [ { value: "joao.severo", msg: "Invalid value for \"email\"" } ] }
-
500
{ status: 500, msg: "Internal error occurred", errors: Any }
PATCH /students/{id}/
Params:
- id: int = id do aluno a complementar informações
Query string:
Nenhuma query string esperada
Payload:
{
student: {
description: "str",
experienceId: 1,
lattesId: 8979
}
}
POST /login/
Params:
Nenhum parâmetro esperadao
Query string:
Nenhuma query string esperada
Payload:
{
email: "str",
password: "str",
isTeacher: 1
}
Responses:
-
204: NO_CONTENT
-
400:
{ status: 400, msg: "Bad request", errors: [ { value: "joao.severo", msg: "Invalid value for \"email\"" } ] }
-
401:
{ status: 401, msg: "Bad request", errors: [ { value: "email/password", msg: "Invalid email or password" } ] }
-
500
{ status: 500, msg: "Internal error occurred", errors: Any }
GET /teachers/{id}/
Params:
- id: int = id do professor que se deseja abrir o perfil
Query string:
Nenhuma query string esperada
Payload:
Nenhum payload esperado
Responses:
- 200:
{ status: 200, msg: "Success", teacher: { id: 10, name: "str", birthday: 11/06/1999, email: "str", lattersURL: "str", gender: { name: "str" }, h_index: 10 } }
- 400:
{ status: 400, msg: "Bad request", errors: [ { value: "", msg: "Invalid value for \"id\"" } ] }
- 404
{ status: 404, msg: "Bad request", errors: [ { value: 10, msg: "Student not found with id=10" } ] }
- 500
{ status: 500, msg: "Internal error occurred", errors: Any }