Obtém o histórico de regas de uma planta

GET /watering/history/{users_plants_id}

Retorna uma lista de todas as regas registradas para uma planta específica.

Path parameters

  • users_plants_id integer Required

    ID da planta do utilizador.

Responses

  • 200 application/json

    Histórico de regas obtido com sucesso

    Hide response attributes Show response attributes object
    • id integer

      ID do registro de rega.

    • users_plants_id integer

      ID da planta do utilizador.

    • watering_type string

      Tipo de rega exemplo = manual.

    • created_at string(date-time)

      Data e hora da rega.

  • 404 application/json

    Planta não encontrada

    Hide response attribute Show response attribute object
    • message string
GET /watering/history/{users_plants_id}
curl \
 --request GET 'http://localhost:8000/watering/history/{users_plants_id}'
Response examples (200)
[
  {
    "id": 42,
    "users_plants_id": 42,
    "watering_type": "string",
    "created_at": "2025-05-04T09:42:00Z"
  }
]
Response examples (404)
{
  "message": "Planta não encontrada."
}