USP Aberta · Desenvolvedores
unit-departments
Lista os departamentos de uma unidade
Departamentos ativos da unidade, ordenados por sigla.
GET /academic-units/{unit_key}/departments{?include_archived} · 1 créditos · Desde a versão 2.0
Variáveis de caminho
| Nome | Tipo | Descrição |
|---|---|---|
unit_key | string obrigatório | Identificador da unidade: slug atual, slug antigo, chave, sigla ou id. |
Parâmetros de consulta
| Nome | Tipo | Descrição |
|---|---|---|
include_archived | boolean opcional | Inclui departamentos arquivados. (padrão: false) |
limit | integer opcional | Quantidade máxima de itens na página. (padrão: 20)1–100 |
cursor | string opcional | Cursor opaco devolvido em `_links.next` ou `_links.prev`; não o construa. |
fields | string[] opcional | Campos de cada item a devolver (lista separada por vírgulas). |
Campos da resposta
| Nome | Tipo | Descrição |
|---|---|---|
key | string | Identificador imutável dentro da unidade. schema.org/identifier |
slug | string | Segmento público da URL. |
acronym | string | Sigla de exibição. schema.org/alternateName |
name | string | null | Nome por extenso. schema.org/name |
description | string | null | Descrição em HTML sanitizado. schema.org/description |
director | string | null | Chefia. schema.org/employee |
viceDirector | string | null | Vice-chefia. schema.org/employee |
archivedAt | datetime | null | Quando foi arquivado; nulo se ativo. |
facultyCount | integer | Docentes distintos vinculados. schema.org/numberOfEmployees |
academicUnitKey | string | Chave da unidade a que pertence. schema.org/parentOrganization |
academicUnitAcronym | string | Sigla da unidade a que pertence. |
Links que a resposta oferece
| Nome | Descrição |
|---|---|
up | Unidade a que pertence. |
Substitui as rotas legadas: departments-by-unit
Exemplos de código
curl -s 'https://uspaberta.ime.usp.br/api/v2/academic-units/ime/departments' \
-H 'Authorization: Bearer '"$USPA_API_KEY" \
-H 'Accept: application/hal+json'Resposta
Resposta real da API: GET /academic-units/ime/departments
HTTP 200
content-type: application/hal+json
etag: W/"g0-9537b4c5c6b22efc"
cache-control: private, max-age=300, must-revalidate
content-language: pt-BR
vary: Accept, Accept-Language
ratelimit-policy: "daily";q=4000;w=86400, "burst";q=60;w=60
uspa-credit-cost: 1{
"_embedded": {
"item": [
{
"_links": {
"self": {
"href": "https://uspaberta.ime.usp.br/api/v2/academic-units/ime/departments/mac"
},
"up": {
"href": "https://uspaberta.ime.usp.br/api/v2/academic-units/ime"
}
},
"academicUnitAcronym": "ime",
"academicUnitKey": "ime",
"acronym": "mac",
"archivedAt": null,
"description": null,
"director": null,
"facultyCount": 37,
"key": "mac",
"name": "Departamento de Ciência da Computação",
"slug": "mac",
"viceDirector": null
},
{
"_links": {
"self": {
"href": "https://uspaberta.ime.usp.br/api/v2/academic-units/ime/departments/mae"
},
"up": {
"href": "https://uspaberta.ime.usp.br/api/v2/academic-units/ime"
}
},
"academicUnitAcronym": "ime",
"academicUnitKey": "ime",
"acronym": "mae",
"archivedAt": null,
"description": null,
"director": null,
"facultyCount": 37,
"key": "mae",
"name": "Departamento de Estatistica",
"slug": "mae",
"viceDirector": null
}
]
},
"_links": {
"curies": [
{
"href": "https://uspaberta.ime.usp.br/api/v2/rels/{rel}",
"templated": true,
"name": "uspa"
}
],
"first": {
"href": "https://uspaberta.ime.usp.br/api/v2/academic-units/ime/departments"
},
"self": {
"href": "https://uspaberta.ime.usp.br/api/v2/academic-units/ime/departments"
},
"up": {
"href": "https://uspaberta.ime.usp.br/api/v2/academic-units/ime"
}
},
"count": 4
}USP Aberta · Developers
unit-departments
List a unit's departments
The unit's active departments, ordered by acronym.
GET /academic-units/{unit_key}/departments{?include_archived} · 1 credits · Since version 2.0
Path variables
| Name | Type | Description |
|---|---|---|
unit_key | string required | Unit identifier: current slug, old slug, key, acronym or id. |
Query parameters
| Name | Type | Description |
|---|---|---|
include_archived | boolean optional | Include archived departments. (default: false) |
limit | integer optional | Maximum number of items in the page. (default: 20)1–100 |
cursor | string optional | Opaque cursor returned in `_links.next` or `_links.prev`; never build one. |
fields | string[] optional | Item fields to return (comma separated list). |
Response fields
| Name | Type | Description |
|---|---|---|
key | string | Immutable identifier inside the unit. schema.org/identifier |
slug | string | Public URL segment. |
acronym | string | Display acronym. schema.org/alternateName |
name | string | null | Full name. schema.org/name |
description | string | null | Description as sanitized HTML. schema.org/description |
director | string | null | Head of department. schema.org/employee |
viceDirector | string | null | Deputy head. schema.org/employee |
archivedAt | datetime | null | When it was archived; null if active. |
facultyCount | integer | Distinct linked faculty members. schema.org/numberOfEmployees |
academicUnitKey | string | Key of the owning unit. schema.org/parentOrganization |
academicUnitAcronym | string | Acronym of the owning unit. |
Links the response offers
| Name | Description |
|---|---|
up | The owning unit. |
Replaces legacy routes: departments-by-unit
Code samples
curl -s 'https://uspaberta.ime.usp.br/api/v2/academic-units/ime/departments' \
-H 'Authorization: Bearer '"$USPA_API_KEY" \
-H 'Accept: application/hal+json'Response
Real response from the API: GET /academic-units/ime/departments
HTTP 200
content-type: application/hal+json
etag: W/"g0-bec6d0af6312d014"
cache-control: private, max-age=300, must-revalidate
content-language: en
vary: Accept, Accept-Language
ratelimit-policy: "daily";q=4000;w=86400, "burst";q=60;w=60
uspa-credit-cost: 1{
"_embedded": {
"item": [
{
"_links": {
"self": {
"href": "https://uspaberta.ime.usp.br/api/v2/academic-units/ime/departments/mac"
},
"up": {
"href": "https://uspaberta.ime.usp.br/api/v2/academic-units/ime"
}
},
"academicUnitAcronym": "ime",
"academicUnitKey": "ime",
"acronym": "mac",
"archivedAt": null,
"description": null,
"director": null,
"facultyCount": 37,
"key": "mac",
"name": "Departamento de Ciência da Computação",
"slug": "mac",
"viceDirector": null
},
{
"_links": {
"self": {
"href": "https://uspaberta.ime.usp.br/api/v2/academic-units/ime/departments/mae"
},
"up": {
"href": "https://uspaberta.ime.usp.br/api/v2/academic-units/ime"
}
},
"academicUnitAcronym": "ime",
"academicUnitKey": "ime",
"acronym": "mae",
"archivedAt": null,
"description": null,
"director": null,
"facultyCount": 37,
"key": "mae",
"name": "Departamento de Estatistica",
"slug": "mae",
"viceDirector": null
}
]
},
"_links": {
"curies": [
{
"href": "https://uspaberta.ime.usp.br/api/v2/rels/{rel}",
"templated": true,
"name": "uspa"
}
],
"first": {
"href": "https://uspaberta.ime.usp.br/api/v2/academic-units/ime/departments"
},
"self": {
"href": "https://uspaberta.ime.usp.br/api/v2/academic-units/ime/departments"
},
"up": {
"href": "https://uspaberta.ime.usp.br/api/v2/academic-units/ime"
}
},
"count": 4
}USP Aberta · Desarrolladores
unit-departments
Lista los departamentos de una unidad
Departamentos activos de la unidad, ordenados por sigla.
GET /academic-units/{unit_key}/departments{?include_archived} · 1 créditos · Desde la versión 2.0
Variables de ruta
| Nombre | Tipo | Descripción |
|---|---|---|
unit_key | string obligatorio | Identificador de la unidad: slug actual, slug anterior, clave, sigla o id. |
Parámetros de consulta
| Nombre | Tipo | Descripción |
|---|---|---|
include_archived | boolean opcional | Incluye departamentos archivados. (predeterminado: false) |
limit | integer opcional | Número máximo de elementos por página. (predeterminado: 20)1–100 |
cursor | string opcional | Cursor opaco devuelto en `_links.next` o `_links.prev`; nunca lo construya. |
fields | string[] opcional | Campos de cada elemento a devolver (lista separada por comas). |
Campos de la respuesta
| Nombre | Tipo | Descripción |
|---|---|---|
key | string | Identificador inmutable dentro de la unidad. schema.org/identifier |
slug | string | Segmento público de la URL. |
acronym | string | Sigla mostrada. schema.org/alternateName |
name | string | null | Nombre completo. schema.org/name |
description | string | null | Descripción en HTML saneado. schema.org/description |
director | string | null | Jefe del departamento. schema.org/employee |
viceDirector | string | null | Subjefe. schema.org/employee |
archivedAt | datetime | null | Fecha de archivo; null si está activo. |
facultyCount | integer | Docentes distintos vinculados. schema.org/numberOfEmployees |
academicUnitKey | string | Clave de la unidad propietaria. schema.org/parentOrganization |
academicUnitAcronym | string | Sigla de la unidad propietaria. |
Enlaces que ofrece la respuesta
| Nombre | Descripción |
|---|---|
up | La unidad propietaria. |
Reemplaza rutas heredadas: departments-by-unit
Ejemplos de código
curl -s 'https://uspaberta.ime.usp.br/api/v2/academic-units/ime/departments' \
-H 'Authorization: Bearer '"$USPA_API_KEY" \
-H 'Accept: application/hal+json'Respuesta
Respuesta real de la API: GET /academic-units/ime/departments
HTTP 200
content-type: application/hal+json
etag: W/"g0-1bd4468b8b5e2fea"
cache-control: private, max-age=300, must-revalidate
content-language: es
vary: Accept, Accept-Language
ratelimit-policy: "daily";q=4000;w=86400, "burst";q=60;w=60
uspa-credit-cost: 1{
"_embedded": {
"item": [
{
"_links": {
"self": {
"href": "https://uspaberta.ime.usp.br/api/v2/academic-units/ime/departments/mac"
},
"up": {
"href": "https://uspaberta.ime.usp.br/api/v2/academic-units/ime"
}
},
"academicUnitAcronym": "ime",
"academicUnitKey": "ime",
"acronym": "mac",
"archivedAt": null,
"description": null,
"director": null,
"facultyCount": 37,
"key": "mac",
"name": "Departamento de Ciência da Computação",
"slug": "mac",
"viceDirector": null
},
{
"_links": {
"self": {
"href": "https://uspaberta.ime.usp.br/api/v2/academic-units/ime/departments/mae"
},
"up": {
"href": "https://uspaberta.ime.usp.br/api/v2/academic-units/ime"
}
},
"academicUnitAcronym": "ime",
"academicUnitKey": "ime",
"acronym": "mae",
"archivedAt": null,
"description": null,
"director": null,
"facultyCount": 37,
"key": "mae",
"name": "Departamento de Estatistica",
"slug": "mae",
"viceDirector": null
}
]
},
"_links": {
"curies": [
{
"href": "https://uspaberta.ime.usp.br/api/v2/rels/{rel}",
"templated": true,
"name": "uspa"
}
],
"first": {
"href": "https://uspaberta.ime.usp.br/api/v2/academic-units/ime/departments"
},
"self": {
"href": "https://uspaberta.ime.usp.br/api/v2/academic-units/ime/departments"
},
"up": {
"href": "https://uspaberta.ime.usp.br/api/v2/academic-units/ime"
}
},
"count": 4
}