API Documentatie
REST API v1
API Sleutel
🔑 Authenticatie
Alle endpoints vereisen authenticatie via de x-api-key header. Genereer je API sleutel in de Instellingen.
Vereiste headers:
Content-Type: application/json
x-api-key: YOUR_API_KEY
BASE URL
https://kitchenagent.app/api/functions
đź“‹ Algemene informatie
• Protocol: HTTPS
• Method: POST (alle endpoints)
• Content-Type: application/json
• Authenticatie: API key via header
• Response formaat: JSON
đź’» Code voorbeelden
Integreer de API vanuit elke omgeving die HTTP ondersteunt.
cURL
curl -X POST "https://kitchenagent.app/api/functions/apiGetPlannedMeals" \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
  "dateFrom": "2026-03-10",
  "dateTo": "2026-03-16"
}'
JavaScript / Node.js
const response = await fetch('https://kitchenagent.app/api/functions/apiGetPlannedMeals', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'x-api-key': 'YOUR_API_KEY'
  },
  body: JSON.stringify({
    dateFrom: '2026-03-10',
    dateTo: '2026-03-16'
  })
});

const data = await response.json();
console.log(data.meals);
Python
import requests

response = requests.post(
    'https://kitchenagent.app/api/functions/apiGetPlannedMeals',
    headers={
        'Content-Type': 'application/json',
        'x-api-key': 'YOUR_API_KEY'
    },
    json={
        'dateFrom': '2026-03-10',
        'dateTo': '2026-03-16'
    }
)

data = response.json()
print(data['meals'])
📚 API Endpoints
⚠️ Error Handling
De API retourneert standaard HTTP status codes:
200Success - Request succesvol afgehandeld
400Bad Request - Ongeldige parameters
401Unauthorized - Ongeldige of ontbrekende API key
404Not Found - Resource niet gevonden
500Server Error - Interne serverfout
Voorbeeld error response:
{
  "error": "Missing API key"
}
🔌 Integratie voorbeeld
Voorbeeld voor integratie in een andere Base44 app via backend functie:
// functions/getMeals.js
Deno.serve(async (req) => {
  const apiKey = Deno.env.get("MEALMANAGER_API_KEY");
  const { dateFrom, dateTo } = await req.json();
  
  const response = await fetch('https://kitchenagent.app/api/functions/apiGetPlannedMeals', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'x-api-key': apiKey
    },
    body: JSON.stringify({ dateFrom, dateTo })
  });
  
  const data = await response.json();
  return Response.json(data);
});