76 lines
1.6 KiB
Markdown
76 lines
1.6 KiB
Markdown
# API-Endpunkte
|
|
|
|
Diese Endpunkte decken die Kernfunktionen von OnlyPrompt ab.
|
|
|
|
## Auth
|
|
|
|
### `POST /api/v1/auth/register`
|
|
- Erstellt einen neuen Benutzer.
|
|
|
|
### `POST /api/v1/auth/login`
|
|
- Loggt einen Benutzer ein.
|
|
|
|
### `GET /api/v1/auth/me`
|
|
- Gibt den aktuell eingeloggten Benutzer zurueck.
|
|
|
|
## User / Profile
|
|
|
|
### `GET /api/v1/users/{id}`
|
|
- Ruft das oeffentliche Benutzerprofil anhand der ID ab.
|
|
|
|
### `GET /api/v1/profile/me`
|
|
- Ruft das eigene Profil des eingeloggten Benutzers ab.
|
|
|
|
### `PUT /api/v1/profile/me`
|
|
- Bearbeitet das eigene Profil des eingeloggten Benutzers.
|
|
|
|
## Prompts
|
|
|
|
### `GET /api/v1/prompts`
|
|
- Gibt alle veroeffentlichten Prompts zurueck.
|
|
|
|
### `GET /api/v1/prompts/{id}`
|
|
- Ruft einen einzelnen Prompt anhand der ID ab.
|
|
|
|
### `POST /api/v1/prompts`
|
|
- Erstellt einen neuen Prompt.
|
|
|
|
### `PUT /api/v1/prompts/{id}`
|
|
- Bearbeitet einen bestehenden Prompt.
|
|
|
|
### `DELETE /api/v1/prompts/{id}`
|
|
- Loescht einen Prompt.
|
|
|
|
## Filter fuer Marketplace
|
|
|
|
### `GET /api/v1/prompts?category=coding`
|
|
- Filtert Prompts nach Kategorie.
|
|
|
|
### `GET /api/v1/prompts?search=python`
|
|
- Sucht Prompts ueber einen Suchbegriff.
|
|
|
|
### `GET /api/v1/prompts?creatorId=5`
|
|
- Filtert Prompts nach einem bestimmten Creator.
|
|
|
|
## Kategorien
|
|
|
|
### `GET /api/v1/categories`
|
|
- Gibt alle verfuegbaren Kategorien zurueck.
|
|
|
|
## Kaeufe
|
|
|
|
### `POST /api/v1/purchases`
|
|
- Erstellt einen Kauf fuer einen Prompt.
|
|
|
|
### `GET /api/v1/purchases/me`
|
|
- Gibt alle eigenen Kaeufe des eingeloggten Benutzers zurueck.
|
|
|
|
## Reviews
|
|
|
|
### `GET /api/v1/prompts/{id}/reviews`
|
|
- Ruft alle Bewertungen fuer einen Prompt ab.
|
|
|
|
### `POST /api/v1/prompts/{id}/reviews`
|
|
- Erstellt eine neue Bewertung fuer einen Prompt.
|
|
|