4.9 KiB
4.9 KiB
REST API Übersicht (aus Client-Calls im Projekt abgeleitet)
- Base URL:
VITE_WEBHOOK_URL(siehesrc/lib/config.ts -> getWebhookUrl()) - Auth:
- Cookies werden standardmäßig mitgesendet (
credentials: 'include') - Falls vorhanden wird
Authorization: Bearer <token>gesetzt (sieheapiFetch) - Bei
401wird automatisch Refresh versucht über/auth/rnjwt
- Cookies werden standardmäßig mitgesendet (
Auth
-
POST /auth_login
- Headers:
Content-Type: application/json - Body:
{ "email": "string", "password": "string" } - Response:
{ "token": "string", "user": { ... } }
- Headers:
-
GET /auth/rnjwt
- Zweck: JWT Refresh
- Response:
{ "token": "string" }
Events
-
POST /event/new_manual
- Headers:
Content-Type: application/json - Body:
{ "name": "string", "description": "string?", "location": "string?", "url": "string?", "image": "string?", "manager_name": "string?", "manager_email": "string?", "begin_date": "YYYY-MM-DD?", "end_date": "YYYY-MM-DD?" } - Response: beliebiges Event-Objekt
- Headers:
-
GET /events/get_current
- Response:
Event[]oder ein einzelnes Event-Objekt
- Response:
-
GET /events
- Response:
Event[]oder ein einzelnes Event-Objekt
- Response:
-
POST /event/new_fromurl
- Headers:
Content-Type: application/json - Body:
{ "url": "string", "command": "eventmodus_extract_from_url" } - Response:
data.message_from_aioder Roh-Response
- Headers:
Blog
-
GET /blog/new_blog
- Response:
{ "id": "string" } // oder { "blog_id": "string" }
- Response:
-
POST /blog/publish
- Headers:
Content-Type: application/json - Body:
{ "blog_id": "string", "publish_date": "YYYY-MM-DD", "publish_socialmedia": true, "socialmedia_channels": ["string"], "socialmedia_languages": ["string"] } - Response: beliebige Publikations-Infos
- Headers:
-
POST /blog/update
- Headers:
Content-Type: application/json - Body:
{ "blog_id": "string", "content": { ... } } - Response: Update-Ergebnis
- Headers:
-
POST /blog/generate
- Headers:
Content-Type: application/json - Body:
{ "blog_Id": "string", "topic": "string", "tonality": "string", "languages": ["string"] } - Response: generierter Blog-Content
- Headers:
-
GET /blog/topic_suggestion
- Response:
{ "topics": ["string", ...] } | ["string", ...]
- Response:
Dateien & Medien
-
POST /file_upload_blog
- Body (FormData):
file: Fileblog_id: string
- Response:
{ "url": "string", ... }
- Body (FormData):
-
POST /file_upload_event
- Body (FormData):
file: Fileevent_id: string
- Response:
{ "url": "string", ... }
- Body (FormData):
-
POST /upload_tmp
- Body (FormData):
file: File
- Response:
{ "url": "string", ... }
- Body (FormData):
-
POST /media/image_generator
- Headers:
Content-Type: application/json - Body:
{ "blog_id": "string", "title": "string" } - Response:
{ "url": "string" } // oder { "imageUrl": "string" }
- Headers:
-
Hinweis:
generateAIImageruft aktuell- POST /file_upload
- Headers:
Content-Type: application/json - Body:
{ "prompt": "string" } - Response:
{ "imageUrl": "string", ... } - Anmerkung: Endpoint-Name wirkt untypisch für Image-Generation.
Tools
- POST /tools/speech2text
- Body (FormData):
file: Audio-Datei
- Response:
{ "transcription": "string" } // oder "text", "result"
- Body (FormData):
Social Media
-
POST /socialmedia/post2event
- Headers:
Content-Type: application/json - Body: frei, je nach Nutzungsfall (Payload für Generierung)
- Response: generierte Posts
- Headers:
-
POST /socialmedia/publish_post
- Headers:
Content-Type: application/json - Body:
{ "postId": "string", "posts": { ... }, "images": { ... }, "scheduledTime": "string" } - Response: Veröffentlichungs-Ergebnis
- Headers:
Gemeinsame Aspekte
- Headers
Content-Type: application/jsonbei JSON-Requests- FormData-Uploads ohne explizites
Content-Type(Browser setzt Multi‑Part)
- Auth
- Cookies via
credentials: 'include' - Optionaler Bearer-Token via
Authorization - Auto-Refresh bei 401 über
/auth/rnjwt, danach Retry
- Cookies via
- Statuscodes
- Client erwartet
response.ok === truebei Erfolg, sonst Fehlerwurf
- Client erwartet
- Variabilität
- Einige Responses sind polymorph (Array oder Objekt). Umgang entsprechend im Client.
Beispiel: apiFetch Verhalten
- Sendet automatisch Cookies
- Fügt
Authorization: Bearer <token>hinzu, wenn verfügbar - Bei 401:
- versucht
GET /auth/rnjwt - wiederholt Request mit neuem Token
- bei erneutem 401: Logout und Fehlermeldung
- versucht