Skip to content

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

MinhasConversas

FieldTypeRequiredConstraintsDescription
itemslist of MinhaConversayes

On error: ErroApi model.

Example

bash
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

ParameterTypeRequiredConstraintsDescription
turmaIdstring (uuid)yesClass id.

Query parameters

ParameterTypeRequiredConstraintsDescription
antesstringnoto 200 characters; ^[A-Za-z0-9_-]+$Cursor: returns messages before it.
depoisstringnoto 200 characters; ^[A-Za-z0-9_-]+$Cursor: returns messages after it.
alteradasDesdestring (date-time)noInstant (agora from the previous read): returns only what changed since then.
limiteintegerno1…100; default: 50How many items per page (1 to 200; the default varies by route, usually 50).

Response

ConversaPagina

FieldTypeRequiredConstraintsDescription
turmaobjectyes
turma.idstring (uuid)yes
turma.nomestringyes
turma.disciplinaNomestringyes
turma.ativabooleanyes
itenslist of MensagemDtoyesOldest to newest.
anterioresstring or nullyesCursor to fetch earlier messages; null = reached the beginning.
podeEscreverbooleanyes
podeModerarbooleanyes
alteradaslist of MensagemDtoyesMessages edited or removed since alteradasDesde (for polling): the client replaces the ones it has.
agorastringyesServer clock at read time (use it as the next alteradasDesde).

On error: ErroApi model.

Example

bash
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

ParameterTypeRequiredConstraintsDescription
turmaIdstring (uuid)yesClass id.

Request body (MensagemTexto)

FieldTypeRequiredConstraintsDescription
textostringyes1–2000 characters

Response

MensagemDto

FieldTypeRequiredConstraintsDescription
idstring (uuid)yes
turmaIdstring (uuid)yes
autorobject or nullyesNull when the author deleted their account.
autor.idstring (uuid)yes
autor.nomestringyes
textostring or nullyesNull when the message was removed (the text is erased on removal).
criadaEmstringyes
editadaEmstring or nullyes
removidabooleanyes
removidaPorModeracaobooleanyesRemoved by a moderator (not by the author).
cursorstringyesThis message's cursor (use it in depois or antes).

On error: ErroApi model.

Example

bash
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

ParameterTypeRequiredConstraintsDescription
mensagemIdstring (uuid)yesMessage id.
turmaIdstring (uuid)yesClass id.

Response

MensagemDto

FieldTypeRequiredConstraintsDescription
idstring (uuid)yes
turmaIdstring (uuid)yes
autorobject or nullyesNull when the author deleted their account.
autor.idstring (uuid)yes
autor.nomestringyes
textostring or nullyesNull when the message was removed (the text is erased on removal).
criadaEmstringyes
editadaEmstring or nullyes
removidabooleanyes
removidaPorModeracaobooleanyesRemoved by a moderator (not by the author).
cursorstringyesThis message's cursor (use it in depois or antes).

On error: ErroApi model.

Example

bash
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

ParameterTypeRequiredConstraintsDescription
mensagemIdstring (uuid)yesMessage id.
turmaIdstring (uuid)yesClass id.

Request body (MensagemTexto)

FieldTypeRequiredConstraintsDescription
textostringyes1–2000 characters

Response

MensagemDto

FieldTypeRequiredConstraintsDescription
idstring (uuid)yes
turmaIdstring (uuid)yes
autorobject or nullyesNull when the author deleted their account.
autor.idstring (uuid)yes
autor.nomestringyes
textostring or nullyesNull when the message was removed (the text is erased on removal).
criadaEmstringyes
editadaEmstring or nullyes
removidabooleanyes
removidaPorModeracaobooleanyesRemoved by a moderator (not by the author).
cursorstringyesThis message's cursor (use it in depois or antes).

On error: ErroApi model.

Example

bash
curl -X PATCH "$API/turmas/{turmaId}/conversa/mensagens/{mensagemId}" -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -d '{"texto":"texto"}'

contato@presente.app.br