From d7dfa2e2eaae1bfdc8d6fb7d8a2c1b6a738dba3e Mon Sep 17 00:00:00 2001 From: Martin Porwoll Date: Sat, 17 Jan 2026 17:23:10 +0000 Subject: [PATCH] docs: add Community Management APIs to FRONTEND.md and API_ANLEITUNG.md Add documentation for YouTube/Meta integration: - YouTube Channels, Content, Series, Notifications APIs - Social Platforms, Accounts, Community Interactions APIs - Code examples for frontend integration - Field documentation with curl examples Co-Authored-By: Claude Opus 4.5 --- docs/anleitungen/API_ANLEITUNG.md | 222 +++++++++++++++++++++++++++++- docs/anleitungen/FRONTEND.md | 53 ++++++- 2 files changed, 272 insertions(+), 3 deletions(-) diff --git a/docs/anleitungen/API_ANLEITUNG.md b/docs/anleitungen/API_ANLEITUNG.md index 96d4f44..7b3f4fe 100644 --- a/docs/anleitungen/API_ANLEITUNG.md +++ b/docs/anleitungen/API_ANLEITUNG.md @@ -953,13 +953,25 @@ Das System verwendet einen zentralen Rate-Limiter mit Redis-Backend (Fallback au | Timelines | `timelines` | Ja | Chronologische Events | | Workflows | `workflows` | Ja | Prozess-Darstellungen | -### BlogWoman Collections (NEU) +### BlogWoman Collections | Collection | Slug | Öffentlich | Beschreibung | |------------|------|------------|--------------| | Favorites | `favorites` | Ja | Affiliate-Produkte mit Kategorien/Badges | | Series | `series` | Ja | YouTube-Serien mit Branding | +### Community Management (YouTube/Meta) + +| Collection | Slug | Öffentlich | Beschreibung | +|------------|------|------------|--------------| +| YouTube Channels | `youtube-channels` | Nein | Multi-Kanal-Verwaltung | +| YouTube Content | `youtube-content` | Nein | Videos + Shorts mit Statistiken | +| YT Series | `yt-series` | Nein | Serien mit Branding (Logo, Farben) | +| YT Notifications | `yt-notifications` | Nein | Handlungsbedarf-System | +| Social Platforms | `social-platforms` | Nein | Plattform-Konfiguration | +| Social Accounts | `social-accounts` | Nein | OAuth-Verbindungen | +| Community Interactions | `community-interactions` | Nein | Kommentare/Nachrichten aller Plattformen | + ### Formulare & Newsletter | Collection | Slug | Öffentlich | Beschreibung | @@ -1058,6 +1070,212 @@ curl "https://pl.porwoll.tech/api/series?where[tenant][equals]=1&where[slug][equ --- +## Community Management APIs (YouTube/Meta) + +### YouTube Channels API + +```bash +# Alle Kanäle +curl "https://pl.porwoll.tech/api/youtube-channels" \ + -H "Authorization: JWT your-token" + +# Einzelner Kanal +curl "https://pl.porwoll.tech/api/youtube-channels/1" \ + -H "Authorization: JWT your-token" +``` + +**Felder:** + +| Feld | Typ | Beschreibung | +|------|-----|--------------| +| `channelId` | string | YouTube Channel ID | +| `title` | string | Kanalname | +| `handle` | string | @handle | +| `thumbnailUrl` | string | Profilbild-URL | +| `subscriberCount` | number | Abonnenten | +| `videoCount` | number | Anzahl Videos | +| `isActive` | boolean | Sync aktiv | + +### YouTube Content API + +```bash +# Alle Videos eines Kanals +curl "https://pl.porwoll.tech/api/youtube-content?where[channel][equals]=1" \ + -H "Authorization: JWT your-token" + +# Nur Videos (keine Shorts) +curl "https://pl.porwoll.tech/api/youtube-content?where[contentType][equals]=video" \ + -H "Authorization: JWT your-token" + +# Videos einer Serie +curl "https://pl.porwoll.tech/api/youtube-content?where[series][equals]=1" \ + -H "Authorization: JWT your-token" + +# Nach Veröffentlichungsdatum sortiert +curl "https://pl.porwoll.tech/api/youtube-content?sort=-publishedAt&limit=10" \ + -H "Authorization: JWT your-token" +``` + +**Felder:** + +| Feld | Typ | Beschreibung | +|------|-----|--------------| +| `videoId` | string | YouTube Video ID | +| `title` | string | Video-Titel | +| `description` | text | Beschreibung | +| `thumbnailUrl` | string | Thumbnail-URL | +| `publishedAt` | date | Veröffentlichungsdatum | +| `contentType` | select | video, short | +| `channel` | relation | YouTube-Kanal | +| `series` | relation | YT-Serie | +| `viewCount` | number | Aufrufe | +| `likeCount` | number | Likes | +| `commentCount` | number | Kommentare | + +### YT Series API + +```bash +# Alle Serien eines Kanals +curl "https://pl.porwoll.tech/api/yt-series?where[channel][equals]=1" \ + -H "Authorization: JWT your-token" + +# Nur aktive Serien +curl "https://pl.porwoll.tech/api/yt-series?where[isActive][equals]=true" \ + -H "Authorization: JWT your-token" +``` + +**Felder:** + +| Feld | Typ | Beschreibung | +|------|-----|--------------| +| `name` | string | Serienname (lokalisiert) | +| `slug` | string | URL-Pfad | +| `description` | textarea | Beschreibung (lokalisiert) | +| `channel` | relation | YouTube-Kanal | +| `logo` | relation | Serien-Logo | +| `coverImage` | relation | Cover-Bild | +| `brandColor` | string | Primärfarbe (Hex) | +| `accentColor` | string | Akzentfarbe (Hex) | +| `youtubePlaylistId` | string | Playlist ID | +| `format` | select | short, longform, mixed | +| `isActive` | boolean | Sichtbarkeit | + +### YT Notifications API (Auth erforderlich) + +```bash +# Alle Benachrichtigungen +curl "https://pl.porwoll.tech/api/yt-notifications" \ + -H "Authorization: JWT your-token" + +# Nur ungelesene +curl "https://pl.porwoll.tech/api/yt-notifications?where[status][equals]=unread" \ + -H "Authorization: JWT your-token" + +# Nach Priorität +curl "https://pl.porwoll.tech/api/yt-notifications?where[priority][equals]=high" \ + -H "Authorization: JWT your-token" +``` + +**Felder:** + +| Feld | Typ | Beschreibung | +|------|-----|--------------| +| `type` | select | comment, mention, milestone, alert | +| `priority` | select | low, medium, high, urgent | +| `status` | select | unread, read, actioned, dismissed | +| `title` | string | Benachrichtigungstitel | +| `message` | text | Details | +| `channel` | relation | Betroffener Kanal | +| `content` | relation | Betroffenes Video | + +### Community Interactions API (Auth erforderlich) + +```bash +# Alle Interaktionen +curl "https://pl.porwoll.tech/api/community-interactions" \ + -H "Authorization: JWT your-token" + +# Nach Plattform filtern +curl "https://pl.porwoll.tech/api/community-interactions?where[platform][equals]=1" \ + -H "Authorization: JWT your-token" + +# Nur Kommentare +curl "https://pl.porwoll.tech/api/community-interactions?where[type][equals]=comment" \ + -H "Authorization: JWT your-token" + +# Nach Status +curl "https://pl.porwoll.tech/api/community-interactions?where[status][equals]=pending" \ + -H "Authorization: JWT your-token" + +# Nach Sentiment (AI-Analyse) +curl "https://pl.porwoll.tech/api/community-interactions?where[analysis.sentiment][equals]=negative" \ + -H "Authorization: JWT your-token" +``` + +**Felder:** + +| Feld | Typ | Beschreibung | +|------|-----|--------------| +| `platform` | relation | Social Platform | +| `socialAccount` | relation | Social Account | +| `type` | select | comment, reply, dm, mention | +| `externalId` | string | Plattform-ID | +| `author.name` | string | Autor-Name | +| `author.handle` | string | Autor-Handle | +| `message` | text | Nachrichteninhalt | +| `publishedAt` | date | Veröffentlichungsdatum | +| `status` | select | pending, read, in-progress, done, archived | +| `priority` | select | low, normal, high | +| `analysis.sentiment` | select | positive, neutral, negative | +| `analysis.language` | string | Erkannte Sprache | + +### Social Platforms API + +```bash +# Alle Plattformen +curl "https://pl.porwoll.tech/api/social-platforms" \ + -H "Authorization: JWT your-token" +``` + +**Felder:** + +| Feld | Typ | Beschreibung | +|------|-----|--------------| +| `name` | string | Plattformname | +| `slug` | string | youtube, facebook, instagram | +| `icon` | string | Emoji | +| `color` | string | Brand Color (Hex) | +| `apiConfig.apiType` | select | youtube_v3, facebook_graph, instagram_graph | +| `apiConfig.authType` | select | oauth2, api_key, bearer | +| `isActive` | boolean | Plattform aktiv | + +### Social Accounts API (Auth erforderlich) + +```bash +# Alle verbundenen Accounts +curl "https://pl.porwoll.tech/api/social-accounts" \ + -H "Authorization: JWT your-token" + +# Nach Plattform filtern +curl "https://pl.porwoll.tech/api/social-accounts?where[platform][equals]=1" \ + -H "Authorization: JWT your-token" +``` + +**Felder:** + +| Feld | Typ | Beschreibung | +|------|-----|--------------| +| `platform` | relation | Social Platform | +| `displayName` | string | Anzeigename | +| `accountHandle` | string | @handle | +| `externalId` | string | Plattform-Account-ID | +| `credentials.accessToken` | string | OAuth Token (verschlüsselt) | +| `credentials.tokenExpiresAt` | date | Token-Ablauf | +| `stats.lastSyncedAt` | date | Letzter Sync | +| `isActive` | boolean | Sync aktiv | + +--- + ## Weitere Ressourcen - **Admin Panel:** https://pl.porwoll.tech/admin @@ -1068,4 +1286,4 @@ curl "https://pl.porwoll.tech/api/series?where[tenant][equals]=1&where[slug][equ --- -*Letzte Aktualisierung: 08.01.2026* +*Letzte Aktualisierung: 17.01.2026* diff --git a/docs/anleitungen/FRONTEND.md b/docs/anleitungen/FRONTEND.md index 0dc1750..b68b043 100644 --- a/docs/anleitungen/FRONTEND.md +++ b/docs/anleitungen/FRONTEND.md @@ -149,6 +149,18 @@ NEXT_PUBLIC_TENANT_SLUG=c2s | Favorites | `GET /api/favorites` | Affiliate-Produkte (BlogWoman) | | Series | `GET /api/series` | YouTube-Serien (BlogWoman) | +### Community Management (YouTube/Meta) + +| Collection | Endpoint | Beschreibung | +|------------|----------|--------------| +| YouTube Channels | `GET /api/youtube-channels` | Multi-Kanal-Verwaltung | +| YouTube Content | `GET /api/youtube-content` | Videos + Shorts mit Kommentaren | +| YT Series | `GET /api/yt-series` | Serien mit Branding (Logo, Farben) | +| YT Notifications | `GET /api/yt-notifications` | Handlungsbedarf-System | +| Social Platforms | `GET /api/social-platforms` | Plattform-Konfiguration | +| Social Accounts | `GET /api/social-accounts` | OAuth-Verbindungen | +| Community Interactions | `GET /api/community-interactions` | Kommentare/Nachrichten | + ### Site Settings & Navigation (Tenant-isolierte Collections) > **Hinweis:** SiteSettings und Navigations wurden zu tenant-spezifischen Collections umgewandelt. @@ -463,6 +475,45 @@ journalctl -u frontend-porwoll -f --- +## Community Management Integration + +### YouTube-Inhalte abrufen + +```typescript +// Alle Videos eines Kanals +const videos = await fetch( + 'https://cms.c2sgmbh.de/api/youtube-content?where[channel][equals]=1&where[contentType][equals]=video' +).then(r => r.json()) + +// Serien eines Kanals +const series = await fetch( + 'https://cms.c2sgmbh.de/api/yt-series?where[channel][equals]=1&where[isActive][equals]=true' +).then(r => r.json()) + +// Videos einer Serie +const seriesVideos = await fetch( + 'https://cms.c2sgmbh.de/api/youtube-content?where[series][equals]=1' +).then(r => r.json()) +``` + +### Kommentare/Interaktionen (Auth erforderlich) + +```typescript +// Kommentare eines Videos +const comments = await fetch( + 'https://cms.c2sgmbh.de/api/community-interactions?where[contentId][equals]=VIDEO_ID', + { headers: { 'Authorization': `JWT ${token}` } } +).then(r => r.json()) + +// Ungelesene Benachrichtigungen +const notifications = await fetch( + 'https://cms.c2sgmbh.de/api/yt-notifications?where[status][equals]=unread', + { headers: { 'Authorization': `JWT ${token}` } } +).then(r => r.json()) +``` + +--- + ## Ressourcen - **Payload CMS Docs:** https://payloadcms.com/docs @@ -472,4 +523,4 @@ journalctl -u frontend-porwoll -f --- -*Letzte Aktualisierung: 08.01.2026* +*Letzte Aktualisierung: 17.01.2026*