Student
Get Student
GET - /student/pk_user /
Description
Description
Captura as informações detalhadas de um estudante específico.
Name | In | Type | Default | Nullable | Description |
---|---|---|---|---|---|
Authorization |
header | string | None | No | Obtained in Login |
pk_user |
path variables | string | None | No | Obtained in List Student |
Response Body
200
{
"results": {
"pk_user": 10,
"registration": "00008",
"username": "Aluno 2",
"cpf": "02353336035",
"fk_campus": 1,
"campus_name": "Atitus Educação Passo Fundo",
"phone": "54992358847",
"email": "patrick@piccini.com",
"fk_city": 4911,
"city_name": "Passo Fundo",
"fk_fu": 23,
"fu_name": "Rio Grande do Sul",
"sex": "M",
"birth_date": "1999-12-14",
"created": "2024-05-27T23:32:47",
"edited": "2024-05-27T23:32:46",
"last_login": "2024-05-27T23:32:46",
"is_active": true
}
}
Schema
{
"results": {
"pk_user": integer,
"registration": string,
"username": string,
"cpf": string,
"fk_campus": integer,
"campus_name": string,
"phone": string,
"email": string,
"fk_city": integer,
"city_name": string,
"fk_fu": integer,
"fu_name": string,
"sex": string,
"birth_date": string,
"created": string,
"edited": string,
"last_login": string,
"is_active": boolean
}
}
400
{
"detail": "Não foi possivel encontrar este User.",
"render": 1
}
Schema
{
"detail": string,
"render": integer
}
{
"detail": "Este usuario não é Estudante"
}
Schema
{
"detail": string,
"render": integer
}
500
{
"detail": "Problemas ao visualizar Usuario.",
"error": "descrição do erro interno"
}
Schema
{
"detail": string,
"error": string
}
List Student
GET - /student/list/
Description
Description
Lista todos os estudantes cadastrados no sistema.
Name | In | Type | Default | Nullable | Description |
---|---|---|---|---|---|
Authorization |
header | string | None | No | Obtained in Login |
page |
query param | string | 1 | Yes | |
page_size |
query param | string | 30 | Yes | |
search |
query param | string | None | Yes | Name user to search |
status |
query param | string | 1 | Yes | 1-Active/0-Inative |
Response Body
200
{
"navigation": {
"next": "http://alppi/sys/api/v1/student/list/?page=3&page_size=20", // link para proxima pagina
"previous": "http://alppi/sys/api/v1/student/list/?page=1&page_size=10" // link para pagina anterior
},
"next": 3, // numero da proxima pagina
"previous": 1, // numero na pagina anterior
"count": 1, // quantidade encontrata
"results": [
{
"pk_user": 12,
"registration": "00012",
"username": "Aluno 1",
"is_active": true
},
{
"pk_user": 21,
"registration": "00021",
"username": "Aluno 10",
"is_active": true
},
{
"pk_user": 13,
"registration": "00013",
"username": "Aluno 2",
"is_active": true
}
]
}
Schema
{
"navigation": {
"next": string,
"previous": string
},
"next": integer,
"previous": integer,
"count": integer,
"results": list
}
500
{
"detail": "Problemas ao listar todos os Usuarios.",
"error": "descrição do erro interno"
}
Schema
{
"detail": string,
"error": string
}
Get Student File Template
GET - /student/gettemplate/
Description
Description
Baixa o arquivo de template para criação em massa de usuarios
Name | In | Type | Default | Nullable | Description |
---|---|---|---|---|---|
Authorization |
header | string | None | No | Obtained in Login |
Response Body
200
Arquivo cadastro-student.xlsx
Schema
N/A
400
{
"detail": "Arquivo não encontrado",
"render": 0
}
Schema
{
"detail": string,
"render": integer
}
500
{
"detail": "Problemas ao buscar arquivo para Download",
"error": "descrição do erro interno"
}
Schema
{
"detail": string,
"error": string
}
Upload Student File Template
POST - /student/uploadfile/
Description
Description
Rota para criação estudantes em massa.
Name | In | Type | Default | Nullable | Description |
---|---|---|---|---|---|
Authorization |
header | string | None | No | Obtained in Login |
Request Body
File Template com campos preenchidos
Body Schema
File Template
Response Body
200
{
"results": "Criados X usuários."
}
Schema
{
"results": string
}
400
{
"detail": "CNPJ-CPF invalido",
"render": 1
}
Schema
{
"detail": string,
"render": integer
}
{
"detail": "Numero de registration ja cadastrada!",
"render": 1
}
Schema
{
"detail": string,
"render": integer
}
{
"detail": "Erro nas linhas do arquivo: Linha X: Campos faltantes: X,Y,Z",
"render": 1
}
Schema
{
"detail": string,
"render": integer
}
{
"detail": {
"username": [
"This field is required."
]
},
"render": 0
}
Schema
{
"detail": object,
"render": integer
}
500
{
"detail": "Problemas ao criar estudantees em massa.",
"error": "descrição do erro interno"
}
Schema
{
"detail": string,
"error": string
}
Create Student
POST - /student/create/
Description
Description
Rota para criação de um novo estudante.
Name | In | Type | Default | Nullable | Description |
---|---|---|---|---|---|
Authorization |
header | string | None | No | Obtained in Login |
fk_city |
body | integer | None | No | Obtained in List City |
fk_fu |
body | integer | None | No | Obtained in List City |
Request Body
{
"password": "123",
"cpf":"02353336035",
"username": "Aluno 18",
"phone": "54992358847",
"email": "patrick@piccini.com",
"fk_city": 4911,
"fk_fu": 23,
"sex": "M",
"birth_date": "1999-12-14"
}
Body Schema
{
"password": string,
"cpf": string,
"username": string,
"phone": string,
"email": string,
"fk_city": integer,
"fk_fu": integer,
"sex": string,
"birth_date": string
}
Response Body
200
{
"results": {
"pk_user": 22,
"registration": "00022",
"username": "Aluno 19",
"cpf": "02353336035",
"fk_campus": 1,
"campus_name": "Atitus Educação Passo Fundo",
"phone": "54992358847",
"email": "patrick@piccini.com",
"fk_city": 4911,
"city_name": "Passo Fundo",
"fk_fu": 23,
"fu_name": "Rio Grande do Sul",
"sex": "M",
"birth_date": "1999-12-14",
"created": "2024-08-31T16:24:47",
"edited": "2024-08-31T16:24:46",
"last_login": "2024-08-31T16:24:46",
"is_active": true,
"groups": [
"estudante"
]
}
}
Schema
{
"results": {
"pk_user": integer,
"registration": string,
"username": string,
"cpf": string,
"fk_campus": integer,
"campus_name": string,
"phone": string,
"email": string,
"fk_city": integer,
"city_name": string,
"fk_fu": integer,
"fu_name": string,
"sex": string,
"birth_date": string,
"created": string,
"edited": string,
"last_login": string,
"is_active": boolean,
"groups": array of strings
}
}
400
{
"detail": "CNPJ-CPF invalido",
"render": 1
}
Schema
{
"detail": string,
"render": integer
}
{
"detail": "Numero de registration ja cadastrada!",
"render": 1
}
Schema
{
"detail": string,
"render": integer
}
{
"detail": "Não foi possivel encontrar este User.",
"render": 1
}
Schema
{
"detail": string,
"render": integer
}
{
"detail": {
"username": [
"This field is required."
]
},
"render": 0
}
Schema
{
"detail": object,
"render": integer
}
500
{
"detail": "Problemas ao criar usuario",
"error": "descrição do erro interno"
}
Schema
{
"detail": string,
"error": string
}
Update Student
PUT - /student/pk_user /update/
Description
Description
Rota para a atualização dos dados de um estudante.
Name | In | Type | Default | Nullable | Description |
---|---|---|---|---|---|
Authorization |
header | string | None | No | Obtained in Login |
pk_user |
path variables | string | None | No | Obtained in List Student |
fk_city |
body | integer | None | No | Obtained in List City |
fk_fu |
body | integer | None | No | Obtained in List City |
Request Body
{
"pk_user": 22,
"username": "Aluno 19",
"cpf": "02353336035",
"phone": "54992358847",
"email": "patrick@piccini.com",
"fk_city": 4911,
"fk_fu": 23,
"sex": "M",
"birth_date": "1999-12-14",
"is_active": true
}
Body Schema
{
"pk_user": integer,
"username": string,
"cpf": string,
"phone": string,
"email": string,
"fk_city": integer,
"fk_fu": integer,
"sex": string,
"birth_date": string,
"is_active": boolean
}
Response Body
200
{
"results": {
"pk_user": 22,
"registration": "00022",
"username": "Aluno 19",
"cpf": "02353336035",
"fk_campus": 1,
"campus_name": "Atitus Educação Passo Fundo",
"phone": "54992358847",
"email": "patrick@piccini.com",
"fk_city": 4911,
"city_name": "Passo Fundo",
"fk_fu": 23,
"fu_name": "Rio Grande do Sul",
"sex": "M",
"birth_date": "1999-12-14",
"created": "2024-08-31T16:24:47",
"edited": "2024-08-31T16:24:46",
"last_login": "2024-08-31T16:24:46",
"is_active": true,
"groups": [
"estudante"
]
}
}
Schema
{
"results": {
"pk_user": integer,
"registration": string,
"username": string,
"cpf": string,
"fk_campus": integer,
"campus_name": string,
"phone": string,
"email": string,
"fk_city": integer,
"city_name": string,
"fk_fu": integer,
"fu_name": string,
"sex": string,
"birth_date": string,
"created": string,
"edited": string,
"last_login": string,
"is_active": boolean,
"groups": array of strings
}
}
400
{
"detail": "Não foi possivel encontrar este User.",
"render": 1
}
Schema
{
"detail": string,
"render": integer
}
{
"detail": "CNPJ-CPF invalido",
"render": 1
}
Schema
{
"detail": string,
"render": integer
}
{
"detail": {
"username": [
"This field is required."
]
},
"render": 0
}
Schema
{
"detail": object,
"render": integer
}
500
{
"detail": "Problemas ao editar usuario",
"error": "descrição do erro interno"
}
Schema
{
"detail": string,
"error": string
}
Change Status Student
PUT - /student/pk_user /changestatus/
Description
Description
Rota para a atualização de status de um estudante.
Name | In | Type | Default | Nullable | Description |
---|---|---|---|---|---|
Authorization |
header | string | None | No | Obtained in Login |
pk_user |
path variables | string | None | No | Obtained in List Student |
Request Body
{
"is_active": 1
}
Body Schema
{
"is_active": integer
}
Response Body
200
{
"results": "Usuário atualizado com sucesso."
}
Schema
{
"results": string
}
400
{
"detail": "Não foi possivel encontrar este User.",
"render": 1
}
Schema
{
"detail": string,
"render": integer
}
500
{
"detail": "Problemas ao alterar status de usuario",
"error": "descrição do erro interno"
}
Schema
{
"detail": string,
"error": string
}
Delete Student
DELL - /student/pk_user /delete/
Description
Description
Rota para excluir um estudante.
Name | In | Type | Default | Nullable | Description |
---|---|---|---|---|---|
Authorization |
header | string | None | No | Obtained in Login |
pk_user |
path variables | string | None | No | Obtained in List Student |
Response Body
200
{
"results": "Estudante deletado com sucesso"
}
Schema
{
"results": string
}
400
{
"detail": "Não foi possivel encontrar este User.",
"render": 1
}
Schema
{
"detail": string,
"render": integer
}
500
{
"detail": "Problemas ao deletar Usuario",
"error": "descrição do erro interno"
}
Schema
{
"detail": string,
"error": string
}