46 lines
1023 B
Markdown
46 lines
1023 B
Markdown
# API
|
|
|
|
Base URL in local development: `http://localhost:8080`
|
|
|
|
## Auth
|
|
|
|
- `POST /auth/register`
|
|
- `POST /auth/login`
|
|
- `POST /auth/logout`
|
|
|
|
Successful register/login returns a bearer token. Send it as:
|
|
|
|
```txt
|
|
Authorization: Bearer <token>
|
|
```
|
|
|
|
## Learner
|
|
|
|
- `GET /me`
|
|
- `PATCH /me/preferences`
|
|
- `GET /dashboard`
|
|
- `GET /progress`
|
|
|
|
## Languages
|
|
|
|
- `GET /languages`
|
|
- `GET /languages/{code}/voices`
|
|
|
|
## Lessons and Practice
|
|
|
|
- `POST /lessons/next`
|
|
- `GET /practice/exercises/{id}/audio` (Bearer-Token erforderlich; liefert den Satz der zugänglichen Übung als `audio/mpeg`)
|
|
- `POST /practice/attempts`
|
|
|
|
`GET /practice/exercises/{id}/audio` unterstützt `mode=normal` (Standard), `mode=slow` und `mode=focus&word=water`. Im Fokusmodus spricht Azure zuerst das Wort, dann nach einer Pause den Satz langsam. Das Wort muss im gespeicherten Übungssatz vorkommen.
|
|
|
|
`POST /practice/attempts` expects multipart form data:
|
|
|
|
- `exercise_id`
|
|
- `audio`
|
|
|
|
## Conversation
|
|
|
|
- `POST /conversation/start`
|
|
- `POST /conversation/{id}/turn`
|