Skip to content

Vota no tópico

PUT/api/upvotes/topics/{id}/vote

Auth
Requires a token
API key:
upvotes:write
X-CommunityId
X-CommunityId Send the X-CommunityId of the community the operation happens in.
Endpoint descriptions come straight from the API specification and are in Portuguese for now. The interface around them is translated.

Um voto por pessoa por tópico; idempotente (votar de novo não muda nada). Vale em OPEN, PLANNED e IN_PROGRESS; em DONE, ARCHIVED ou tópico aguardando aprovação, 409. Até 120 votos e retiradas por hora por pessoa (429; sem Redis o limite deixa passar). Sem login, 401.

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)

Headers

NameTypeDescription
X-CommunityIdoptionalstring (uuid)ID da comunidade em que a operação acontece. Obrigatório na maioria dos endpoints com escopo de comunidade.

Request body application/json

The specification does not declare the fields of this body (a multipart upload, for example). See the topic guide.

Responses

StatusDescription
200Contagem atual.
401Token ausente, inválido ou expirado; token de outra comunidade (o `X-CommunityId` ou o `communityId` do corpo não é o do token); token antigo ou de uma sessão encerrada (troca de senha, convite aceito). Nesses casos a mensagem pede para entrar de novo (`auth.signInAgain`).
403Autenticado, mas sem permissão para esta operação.
404Recurso não encontrado.
409Votação fechada (Feito
429Limite de votos por hora.

curl example

curl -X PUT "https://api.memberfy.net/api/upvotes/topics/<id>/vote" \
  -H "Authorization: Bearer $TOKEN" \
  -H "X-CommunityId: $COMMUNITY_ID" \
  -H "Content-Type: application/json" \
  -d '{}'