Class conversation
Messages among a class's participants.
List the person's class conversations
GET /me/conversas
Access: Any signed-in person. Success status: 200.
Response
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
items | list of MinhaConversa | yes |
On error: ErroApi model.
Example
curl -X GET "$API/me/conversas" -H "Authorization: Bearer $TOKEN"List the class conversation's messages
GET /turmas/{turmaId}/conversa
Access: Any signed-in person. Success status: 200.
Path parameters
| Parameter | Type | Required | Constraints | Description |
|---|---|---|---|---|
turmaId | string (uuid) | yes | Class id. |
Query parameters
| Parameter | Type | Required | Constraints | Description |
|---|---|---|---|---|
antes | string | no | to 200 characters; ^[A-Za-z0-9_-]+$ | Cursor: returns messages before it. |
depois | string | no | to 200 characters; ^[A-Za-z0-9_-]+$ | Cursor: returns messages after it. |
alteradasDesde | string (date-time) | no | Instant (agora from the previous read): returns only what changed since then. | |
limite | integer | no | 1…100; default: 50 | How many items per page (1 to 200; the default varies by route, usually 50). |
Response
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
turma | object | yes | ||
turma.id | string (uuid) | yes | ||
turma.nome | string | yes | ||
turma.disciplinaNome | string | yes | ||
turma.ativa | boolean | yes | ||
itens | list of MensagemDto | yes | Oldest to newest. | |
anteriores | string or null | yes | Cursor to fetch earlier messages; null = reached the beginning. | |
podeEscrever | boolean | yes | ||
podeModerar | boolean | yes | ||
alteradas | list of MensagemDto | yes | Messages edited or removed since alteradasDesde (for polling): the client replaces the ones it has. | |
agora | string | yes | Server clock at read time (use it as the next alteradasDesde). |
On error: ErroApi model.
Example
curl -X GET "$API/turmas/{turmaId}/conversa" -H "Authorization: Bearer $TOKEN"Send a message to the class conversation
POST /turmas/{turmaId}/conversa/mensagens
Access: Any signed-in person. Rate limit: up to 60 calls every 60 s per origin. Success status: 201.
Path parameters
| Parameter | Type | Required | Constraints | Description |
|---|---|---|---|---|
turmaId | string (uuid) | yes | Class id. |
Request body (MensagemTexto)
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
texto | string | yes | 1–2000 characters |
Response
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
id | string (uuid) | yes | ||
turmaId | string (uuid) | yes | ||
autor | object or null | yes | Null when the author deleted their account. | |
autor.id | string (uuid) | yes | ||
autor.nome | string | yes | ||
texto | string or null | yes | Null when the message was removed (the text is erased on removal). | |
criadaEm | string | yes | ||
editadaEm | string or null | yes | ||
removida | boolean | yes | ||
removidaPorModeracao | boolean | yes | Removed by a moderator (not by the author). | |
cursor | string | yes | This message's cursor (use it in depois or antes). |
On error: ErroApi model.
Example
curl -X POST "$API/turmas/{turmaId}/conversa/mensagens" -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -d '{"texto":"texto"}'Remove a message
DELETE /turmas/{turmaId}/conversa/mensagens/{mensagemId}
Access: Any signed-in person. Success status: 200.
Path parameters
| Parameter | Type | Required | Constraints | Description |
|---|---|---|---|---|
mensagemId | string (uuid) | yes | Message id. | |
turmaId | string (uuid) | yes | Class id. |
Response
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
id | string (uuid) | yes | ||
turmaId | string (uuid) | yes | ||
autor | object or null | yes | Null when the author deleted their account. | |
autor.id | string (uuid) | yes | ||
autor.nome | string | yes | ||
texto | string or null | yes | Null when the message was removed (the text is erased on removal). | |
criadaEm | string | yes | ||
editadaEm | string or null | yes | ||
removida | boolean | yes | ||
removidaPorModeracao | boolean | yes | Removed by a moderator (not by the author). | |
cursor | string | yes | This message's cursor (use it in depois or antes). |
On error: ErroApi model.
Example
curl -X DELETE "$API/turmas/{turmaId}/conversa/mensagens/{mensagemId}" -H "Authorization: Bearer $TOKEN"Edit a message
PATCH /turmas/{turmaId}/conversa/mensagens/{mensagemId}
Access: Any signed-in person. Rate limit: up to 60 calls every 60 s per origin. Success status: 200.
Path parameters
| Parameter | Type | Required | Constraints | Description |
|---|---|---|---|---|
mensagemId | string (uuid) | yes | Message id. | |
turmaId | string (uuid) | yes | Class id. |
Request body (MensagemTexto)
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
texto | string | yes | 1–2000 characters |
Response
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
id | string (uuid) | yes | ||
turmaId | string (uuid) | yes | ||
autor | object or null | yes | Null when the author deleted their account. | |
autor.id | string (uuid) | yes | ||
autor.nome | string | yes | ||
texto | string or null | yes | Null when the message was removed (the text is erased on removal). | |
criadaEm | string | yes | ||
editadaEm | string or null | yes | ||
removida | boolean | yes | ||
removidaPorModeracao | boolean | yes | Removed by a moderator (not by the author). | |
cursor | string | yes | This message's cursor (use it in depois or antes). |
On error: ErroApi model.
Example
curl -X PATCH "$API/turmas/{turmaId}/conversa/mensagens/{mensagemId}" -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -d '{"texto":"texto"}'