Files
motia/bitbylaw/steps/advoware_proxy/advoware_api_proxy_post_step.md
2026-02-07 09:23:49 +00:00

1.5 KiB

type, category, name, version, status, tags, dependencies, emits
type category name version status tags dependencies emits
step api Advoware Proxy POST 1.0.0 active
advoware
proxy
api
rest
create
services/advoware.py

Advoware Proxy POST Step

Zweck

Universeller REST-API-Proxy für POST-Requests an die Advoware API zum Erstellen neuer Ressourcen.

Unterschied zu GET

  • Method: POST statt GET
  • Body: JSON-Payload aus Request-Body wird an Advoware weitergeleitet
  • Verwendung: Erstellen von Ressourcen (Termine, Employees, etc.)

Input

POST /advoware/proxy?endpoint=appointments
Content-Type: application/json

{
  "datum": "2026-02-10",
  "uhrzeitVon": "09:00:00",
  "text": "Meeting"
}

Output

{
  "status": 200,
  "body": {
    "result": {
      "id": "12345",
      ...
    }
  }
}

Key Differences from GET Step

  1. Request Body (req.get('body')) wird als json_data an API übergeben
  2. Kann Daten in Advoware erstellen (Side-Effects!)
  3. Response enthält oft die neu erstellte Ressource

Testing

curl -X POST "http://localhost:3000/advoware/proxy?endpoint=appointments" \
  -H "Content-Type: application/json" \
  -d '{
    "datum": "2026-02-10",
    "uhrzeitVon": "09:00:00",
    "uhrzeitBis": "10:00:00",
    "text": "Test Meeting"
  }'

KI Guidance

Identisch zu GET-Step, außer:

  • Body-Validierung hinzufügen bei Bedarf
  • Side-Effects beachten (erstellt Daten!)

Siehe advoware_api_proxy_get_step.md für Details.