Disciplines
A institution's disciplines.
Read a discipline
GET /disciplinas/{disciplinaId}
Access: Requires the capability LER over discipline (params.disciplinaId). Success status: 200.
Path parameters
| Parameter | Type | Required | Constraints | Description |
|---|---|---|---|---|
disciplinaId | string (uuid) | yes | Discipline id. |
Response
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
id | string (uuid) | yes | ||
instituicaoId | string (uuid) | yes | ||
sigla | string | yes | ||
nome | string | yes | ||
ementa | string or null | yes | ||
semanas | integer or null | yes | ||
ativo | boolean | yes |
On error: ErroApi model.
Example
curl -X GET "$API/disciplinas/{disciplinaId}" -H "Authorization: Bearer $TOKEN"Update a discipline
PATCH /disciplinas/{disciplinaId}
Access: Requires the capability CADASTRAR over discipline (params.disciplinaId). Success status: 200.
Path parameters
| Parameter | Type | Required | Constraints | Description |
|---|---|---|---|---|
disciplinaId | string (uuid) | yes | Discipline id. |
Request body (DisciplinaAtualizar)
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
sigla | string | no | ^[A-Za-z0-9][A-Za-z0-9._-]{0,14}$ | |
nome | string | no | 1–200 characters | |
ementa | string or null | no | to 10000 characters | |
semanas | integer or null | no | 1…520 | |
ativo | boolean | no |
Response
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
id | string (uuid) | yes | ||
instituicaoId | string (uuid) | yes | ||
sigla | string | yes | ||
nome | string | yes | ||
ementa | string or null | yes | ||
semanas | integer or null | yes | ||
ativo | boolean | yes |
On error: ErroApi model.
Example
curl -X PATCH "$API/disciplinas/{disciplinaId}" -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -d '{}'List an institution's disciplines
GET /instituicoes/{instituicaoId}/disciplinas
Access: Requires the capability LER, in some scope (the response only includes what the person can see). Success status: 200.
Path parameters
| Parameter | Type | Required | Constraints | Description |
|---|---|---|---|---|
instituicaoId | string (uuid) | yes | Institution id. |
Query parameters
| Parameter | Type | Required | Constraints | Description |
|---|---|---|---|---|
busca | string | no | to 100 characters | Search text (name or email, depending on the route). |
limite | integer | no | 1…200; default: 50 | How many items per page (1 to 200; the default varies by route, usually 50). |
deslocamento | integer | no | 0…100000; default: 0 | How many items to skip, for paging (up to 100000). |
inativos | "true" | "false" | no | default: "false" | true also includes inactive records. |
Response
list of DisciplinaDto (+ total)
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
id | string (uuid) | yes | ||
instituicaoId | string (uuid) | yes | ||
sigla | string | yes | ||
nome | string | yes | ||
ementa | string or null | yes | ||
semanas | integer or null | yes | ||
ativo | boolean | yes |
On error: ErroApi model.
Example
curl -X GET "$API/instituicoes/{instituicaoId}/disciplinas" -H "Authorization: Bearer $TOKEN"Create a discipline in the institution
POST /instituicoes/{instituicaoId}/disciplinas
sigla and nome are unique within the institution: repeating returns 409 taken.
Access: Requires the capability CADASTRAR over institution (params.instituicaoId). Success status: 201.
Path parameters
| Parameter | Type | Required | Constraints | Description |
|---|---|---|---|---|
instituicaoId | string (uuid) | yes | Institution id. |
Request body (DisciplinaCriar)
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
sigla | string | yes | ^[A-Za-z0-9][A-Za-z0-9._-]{0,14}$ | |
nome | string | yes | 1–200 characters | |
ementa | string or null | no | to 10000 characters | |
semanas | integer or null | no | 1…520 |
Response
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
id | string (uuid) | yes | ||
instituicaoId | string (uuid) | yes | ||
sigla | string | yes | ||
nome | string | yes | ||
ementa | string or null | yes | ||
semanas | integer or null | yes | ||
ativo | boolean | yes |
On error: ErroApi model.
Example
curl -X POST "$API/instituicoes/{instituicaoId}/disciplinas" -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -d '{"sigla":"texto","nome":"texto"}'