Zum Inhalt springen

Gerät aktualisieren PUT ​

Aktualisiere den Namen oder die Einstellungen eines Geräts.

Endpunkt ​

PUT https://api.pocketalert.app/v1/devices/{tid}

Authentifizierung ​

Erforderlich

Füge eine dieser Header in deiner Anfrage hinzu:

Anfrage ​

Pfadparameter ​

ParameterTypPflichtBeschreibung
tidstring✅Eindeutige Kennung des Geräts
HeaderPflichtBeschreibung
Token✅Dein API-Schlüssel
Authorization✅Bearer <jwt-token>

Body-Parameter ​

ParameterTypPflichtBeschreibung
namestring✅Neuer Gerätename

Beispielanfrage ​

bash
curl -X PUT "https://api.pocketalert.app/v1/devices/9dc24hqldvv2bfx2nlc6r" \
  -H "Token: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{"name": "My iPhone"}'
javascript
const tid = '9dc24hqldvv2bfx2nlc6r';
const response = await fetch(`https://api.pocketalert.app/v1/devices/${tid}`, {
  method: 'PUT',
  headers: {
    'Token': 'your-api-key',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({ name: 'My iPhone' })
});
python
import requests

tid = '9dc24hqldvv2bfx2nlc6r'
response = requests.put(
    f'https://api.pocketalert.app/v1/devices/{tid}',
    headers={'Token': 'your-api-key'},
    json={'name': 'My iPhone'}
)
print(response.json())
php
$tid = '9dc24hqldvv2bfx2nlc6r';
$response = Http::withHeaders([
    'Token' => 'your-api-key',
])->put('https://api.pocketalert.app/v1/devices/'.$tid, [
    'name' => 'My iPhone',
]);

return $response->json();

Antwort ​

Erfolgreiche Antwort ​

200 OK

Gerät erfolgreich aktualisiert

json
{
  "data": "success"
}

Fehlerantworten ​

StatusBeschreibung
401Nicht autorisiert — Token ungültig oder fehlt
404Nicht gefunden — Gerät existiert nicht
400Ungültige Anfrage — ungültiger Request-Body

Pocket Alert Dokumentation