curl \
--request GET 'http://localhost:8000/locations/{id}'
{
"id": 1,
"name": "Varanda"
}
{
"error": "Location not found"
}
http://localhost:8000
API para gestão da aplicação web CultivUA. Desenvolvido por:
This is version 1.0.1
of this API documentation.
Last update on Jan 2, 2025.
curl \
--request GET 'http://localhost:8000/blog-posts/categories'
curl \
--request GET 'http://localhost:8000/blog-posts'
curl \
--request POST 'http://localhost:8000/blog-posts'
curl \
--request GET 'http://localhost:8000/blog-posts/{id}'
curl \
--request PUT 'http://localhost:8000/blog-posts/{id}'
curl \
--request DELETE 'http://localhost:8000/blog-posts/{id}'
curl \
--request GET 'http://localhost:8000/blog-posts/{postId}/comments'
[
{
"comment_id": 42,
"username": "string",
"profile_image": "string",
"comment_text": "string",
"commented_at": "2025-05-04T09:42:00Z",
"isVisible": true
}
]
curl \
--request POST 'http://localhost:8000/blog-posts/add-comment' \
--header "Content-Type: application/json" \
--data '{"comment_text":"string","user_id":42,"post_id":42}'
{
"comment_text": "string",
"user_id": 42,
"post_id": 42
}
{
"id": 42,
"comment_text": "string",
"created_at": "2025-05-04T09:42:00Z",
"user": {
"username": "string",
"profile_image": "string"
}
}
Atualiza a visibilidade de um comentário específico.
curl \
--request PUT 'http://localhost:8000/blog-posts/comments/{commentId}' \
--header "Content-Type: application/json" \
--data '{"isVisible":true}'
{
"isVisible": true
}
{
"message": "Visibilidade do comentário atualizada"
}
curl \
--request DELETE 'http://localhost:8000/blog-posts/comments/{commentId}/delete'
{
"message": "Comentário excluído com sucesso"
}
{
"error": "Comentário não encontrado"
}
curl \
--request GET 'http://localhost:8000/categories'
[
{
"id": 42,
"name": "string",
"mostrarLoja": true,
"mostrarBlog": true,
"number": 42
}
]
curl \
--request POST 'http://localhost:8000/categories' \
--header "Content-Type: application/json" \
--data '{"name":"Vegetables"}'
{
"name": "Vegetables"
}
{
"message": "string",
"category": {
"id": 42,
"name": "string"
}
}
{
"message": "string",
"category": {
"id": 42,
"name": "string"
}
}
curl \
--request GET 'http://localhost:8000/categories/{id}'
{
"id": 42,
"name": "string",
"mostrarLoja": true,
"mostrarBlog": true
}
{
"error": "Categoria não encontrada"
}
curl \
--request PUT 'http://localhost:8000/categories/{id}' \
--header "Content-Type: application/json" \
--data '{"name":"string","mostrarLoja":true,"mostrarBlog":true}'
{
"name": "string",
"mostrarLoja": true,
"mostrarBlog": true
}
{
"message": "Categoria atualizada com sucesso!"
}
curl \
--request DELETE 'http://localhost:8000/categories/{id}'
{
"message": "Categoria deletada com sucesso!"
}
{
"message": "Categoria não encontrada!"
}
curl \
--request GET 'http://localhost:8000/categories/dashboard/stats'
{
"totalUsers": 42,
"totalProductsSold": 42,
"totalSales": 42.0,
"totalActiveGardens": 42,
"totalProducts": 42,
"totalQuestionsAnswered": 42
}
curl \
--request GET 'http://localhost:8000/categories/products/sold'
[
{
"category": "string",
"total_sold": 42
}
]
Gera uma sessão de checkout para múltiplos produtos e calcula os impostos com base no país do cliente.
curl \
--request POST 'http://localhost:8000/create-checkout-session' \
--header "Content-Type: application/json" \
--data '{"amount":120,"cartItems":[{"name":"Produto Exemplo","price":10,"quantity":2}],"customerCountry":"PT"}'
{
"amount": 120,
"cartItems": [
{
"name": "Produto Exemplo",
"price": 10,
"quantity": 2
}
],
"customerCountry": "PT"
}
{
"id": "cs_test_a1b2c3d4e5f6g7h8"
}
{
"error": "Invalid amount."
}
Cria um pedido com os itens do carrinho, o valor total e a quantidade total.
curl \
--request POST 'http://localhost:8000/create-order' \
--header "Content-Type: application/json" \
--data '{"user_id":1,"cartItems":[{"id":101,"quantity":2}],"totalAmount":50.75,"totalQuantity":3}'
{
"user_id": 1,
"cartItems": [
{
"id": 101,
"quantity": 2
}
],
"totalAmount": 50.75,
"totalQuantity": 3
}
{
"message": "Order created successfully!",
"order_id": 123
}
{
"message": "The given data was invalid."
}
curl \
--request GET 'http://localhost:8000/dashboard-stats'
{
"totalUsers": 42,
"totalProductsSold": 42,
"totalSales": 42.0,
"totalActiveGardens": 42,
"totalProducts": 42,
"totalQuestionsAnswered": 42
}
curl \
--request GET 'http://localhost:8000/dashboardplants'
[
{
"id": 42,
"name": "string"
}
]
{
"error": "Erro ao obter plantas do dashboard"
}
curl \
--request DELETE 'http://localhost:8000/deleteTicket/{id}'
{
"message": "string"
}
{
"message": "string"
}
curl \
--request GET 'http://localhost:8000/getproductUp/{id}'
{
"id": 42,
"name": "string",
"price": 42.0,
"stock": 42,
"threshold": 42,
"category": {
"name": "string"
},
"scientific_name": "string",
"description": "string",
"size": "string",
"image": "string",
"isKit": true
}
Recebe uma imagem e retorna informações sobre a planta identificada.
curl \
--request POST 'http://localhost:8000/identify-plant' \
--header "Content-Type: multipart/form-data" \
--form "images[]=@file" \
--form "latitude=42.0" \
--form "longitude=42.0"
{
"plant_id_response": {},
"perenual_response": {}
}
{
"error": "string",
"details": "string"
}
{
"error": "string",
"response": {}
}
{
"error": "string",
"details": "string"
}
curl \
--request GET 'http://localhost:8000/kit/details/{kitId}'
{
"nome": "string",
"localizacao": "string",
"plants": [
{
"name": "string",
"species": "string",
"description": "string",
"ideal_temperature": "string",
"ideal_humidity": "string",
"harvest_season": "string",
"sunlight": "string",
"watering_frequency": "string"
}
]
}
{
"message": "Kit não encontrado"
}
curl \
--request GET 'http://localhost:8000/kit/temperature-data'
{
"averageMonthlyTemperatures": {
"additionalProperty1": 42.0,
"additionalProperty2": 42.0
},
"idealTemperatures": [
"string"
],
"months": [
"string"
]
}
{
"message": "Kit não encontrado ou sem leituras de temperatura"
}
curl \
--request GET 'http://localhost:8000/kit-readings/{kitId}'
[
{
"id": 42,
"kits_id": 42,
"value": "string",
"created_at": "2025-05-04T09:42:00Z"
}
]
{
"error": "Kit não encontrado para o ID fornecido."
}
{
"error": "Erro ao Procurarr as leituras: [detalhes do erro]"
}
curl \
--request GET 'http://localhost:8000/location/{user_plant_id}'
{
"location": {
"id": 42,
"name": "string",
"description": "string"
}
}
{
"error": "Associação de planta não encontrada"
}
curl \
--request POST 'http://localhost:8000/locations' \
--header "Content-Type: application/json" \
--data '{"name":"Varanda"}'
{
"name": "Varanda"
}
{
"id": 2,
"name": "Sala"
}
{
"message": "The given data was invalid."
}
curl \
--request GET 'http://localhost:8000/locations/{id}'
{
"id": 1,
"name": "Varanda"
}
{
"error": "Location not found"
}