Obtém notificações de um utilizador específico

GET /notifications/{userId}

Retorna até 5 notificações não lidas de um utilizador com base no ID.

Path parameters

  • userId integer Required

    ID do utilizador para o qual as notificações são retornadas.

Responses

  • 200 application/json

    Notificações obtidas com sucesso

    Hide response attributes Show response attributes object
    • notifications array[object]
      Hide notifications attributes Show notifications attributes object
      • id integer
      • user_id integer
      • admin boolean
      • message string
      • is_read boolean
      • created_at string(date-time)
    • unread_count integer
  • 404 application/json

    utilizador não encontrado

    Hide response attribute Show response attribute object
    • message string
GET /notifications/{userId}
curl \
 --request GET 'http://localhost:8000/notifications/{userId}'
Response examples (200)
{
  "notifications": [
    {
      "id": 42,
      "user_id": 42,
      "admin": true,
      "message": "string",
      "is_read": true,
      "created_at": "2025-05-04T09:42:00Z"
    }
  ],
  "unread_count": 3
}
Response examples (404)
{
  "message": "utilizador não encontrado"
}