Anmelden POST
Melde dich mit E-Mail und Passwort an, um ein JWT-Token zu erhalten.
Endpunkt
POST https://api.pocketalert.app/v1/auth/signinAnfrage
Header
| Header | Pflicht | Beschreibung |
|---|---|---|
Content-Type | ✅ | application/json |
Body-Parameter
| Parameter | Typ | Pflicht | Beschreibung |
|---|---|---|---|
email | string | ✅ | Deine registrierte E-Mail-Adresse |
password | string | ✅ | Dein Kontopasswort |
Beispielanfrage
bash
curl -X POST "https://api.pocketalert.app/v1/auth/signin" \
-H "Content-Type: application/json" \
-d '{
"email": "[email protected]",
"password": "your-password"
}'javascript
const response = await fetch('https://api.pocketalert.app/v1/auth/signin', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
email: '[email protected]',
password: 'your-password'
})
});
const { token } = await response.json();
// Use token in Authorization header for subsequent requestspython
import requests
response = requests.post(
'https://api.pocketalert.app/v1/auth/signin',
json={
'email': '[email protected]',
'password': 'your-password'
}
)
data = response.json()
# Use token in Authorization header for subsequent requestsphp
$response = Http::post('https://api.pocketalert.app/v1/auth/signin', [
'email' => '[email protected]',
'password' => 'your-password',
]);
$token = $response->json()['token'];
// Use token in Authorization header for subsequent requestsAntwort
Erfolgreiche Antwort
200 OK
Anmeldung erfolgreich
| Feld | Typ | Beschreibung |
|---|---|---|
token | string | JWT-Token für die API-Authentifizierung |
email | string | E-Mail-Adresse des Nutzers |
name | string | Anzeigename des Nutzers |
avatar | string | URL zum Avatarbild des Nutzers |
json
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"email": "[email protected]",
"name": "John Doe",
"avatar": ""
}Token verwenden
Nachdem du das Token erhalten hast, füge es in Folgeanfragen ein:
bash
curl -X GET "https://api.pocketalert.app/v1/messages" \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."Fehlerantworten
| Status | Beschreibung |
|---|---|
400 | Ungültige Anfrage — E-Mail oder Passwort fehlt, oder das Captcha ist fehlgeschlagen |
401 | Ungültige Anmeldedaten — falsches Passwort oder unbekannte E-Mail-Adresse |
Empfehlung
Für serverseitige Integrationen empfehlen wir die Verwendung von API-Schlüsseln statt JWT-Tokens. API-Schlüssel laufen nicht ab und sind einfacher zu verwalten.