TikTok api

This commit is contained in:
2026-07-08 19:03:40 +02:00
parent 01284f5283
commit a7d6d3bce9
5 changed files with 1302 additions and 0 deletions

View File

@@ -0,0 +1,64 @@
# Social Accounts
## Account Mapping
| Brand | Facebook Page | Facebook Page ID | Instagram Business Account | Instagram User ID | X/Twitter Account | Target Username |
| --- | --- | --- | --- | --- | --- | --- |
| QRMaster.net | QRMaster.net | 884792004727212 | QRMaster.net | 17841480094799114 | TIMO_QRMASTER | qrmaster |
| GreenLens Pro | GreenLens Pro | 1150261294842586 | GreenLens Pro | 17841422012320229 | greenlensproai | greenlens.pro |
## Brand Rules
- QRMaster-Posts dürfen **nur** auf `QRMaster.net`-Accounts posten.
- GreenLens-Posts dürfen **nur** auf `GreenLens Pro`-Accounts posten.
- Kein Crossposting zwischen Brands.
- Token niemals öffentlich teilen; nur Referenz in dieser Datei.
## Scripts
| Path | Purpose |
| --- | --- |
| `C:\Users\timo\Documents\meta_token_refresh.py` | Meta Long-Lived + Page Token Refresh |
| `C:\Users\timo\Documents\instagram_r2_carousel_post.py` | Instagram single-image/carousel über R2 |
| `C:\Users\timo\x-api-autopost\x_media_post.py` | X/Twitter for QRMaster |
| `C:\Users\timo\greenlens-x-autopost\` | X/Twitter for GreenLens |
## Token Files / Paths
| Path | Contains |
| --- | --- |
| `C:\Users\timo\Documents\meta_instagram_tokens.env` | Meta Facebook + Instagram long-lived/page tokens |
| `C:\Users\timo\Documents\r2_social_media.env` | R2 upload credentials for IG assets |
| `C:\Users\timo\Documents\instagram_r2_carousel_post.py` | uses both env files above |
| `C:\Users\timo\Documents\XApiAutopost\.env` | X/Twitter QRMaster creds |
| `C:\Users\timo\Documents\greenlens-x-autopost\.env` | X/Twitter GreenLens creds |
| `C:\Users\timo\Documents\greenlens\Greenlens\.env` | GreenLens TikTok + plant import admin creds |
## QRMaster TikTok Cron Credentials
- Source of truth: the server-side `.env` for the QRMaster app.
- Required variables: `TIKTOK_CLIENT_KEY`, `TIKTOK_CLIENT_SECRET`, `TIKTOK_REDIRECT_URI`.
- Optional helper: `TIKTOK_ADMIN_KEY` for guarding the `/api/tiktok/connect` start route.
- OAuth result: access/refresh tokens are stored in the database after `/api/tiktok/connect` and `/api/tiktok/callback`.
- Do not put TikTok access tokens in `.env`; the cron job reads them from the DB through the app flow.
- For cron posting, use the same QRMaster server environment that already contains `CRON_SECRET` / `INTERNAL_API_SECRET` for internal APIs.
## Refresh Behavior
- Meta user/page tokens werden automatisch refreshed durch `python C:\Users\timo\Documents\meta_token_refresh.py`.
- QRMaster Page-Auswahl erzwingt Page-ID `884792004727212`.
- GreenLens Page-Auswahl erzwingt Page-ID `1150261294842586`.
## Cron Jobs
| Job Name | Schedule | Deliver | Notes |
| --- | --- | --- | --- |
| `Weekly Meta Token Refresh` | Montag 09:00 | Telegram + Email | Refreshes Meta tokens |
> Social-package deliverables only after explicit `Go`.
## Publish Checklist
1) Brand wählen → nur passende Accounts zulassen.
2) Media vorbereiten: QRMaster → R2-Prefix `qrmaster/`, GreenLens → `greenlens/`.
3) Facebook: Page-ID + Page-Token verwenden.
4) Instagram: IG User ID + Page-Token über Container + `media_publish`.
5) X: zugehöriges Brand-Skript + zugehöriges `.env` verwenden.
6) Keine Token/Secrets loggen.