Nachricht aktualisieren PUT
Aktualisiere den Inhalt oder den Lesestatus einer bestehenden Nachricht.
Endpunkt
PUT https://api.pocketalert.app/v1/messages/{tid}Authentifizierung
Erforderlich
Füge einen dieser Header in deine Anfrage ein:
Token: <your-api-key>— Hol dir ihn unter API-SchlüsselAuthorization: Bearer <jwt-token>— Aus Anmelden
Anfrage
Pfadparameter
| Parameter | Typ | Pflicht | Beschreibung |
|---|---|---|---|
tid | string | ✅ | Eindeutige ID der Nachricht |
Header
| Header | Pflicht | Beschreibung |
|---|---|---|
Token | ✅ | Dein API-Schlüssel |
Authorization | ✅ | Bearer <jwt-token> |
Body-Parameter
| Parameter | Typ | Pflicht | Beschreibung |
|---|---|---|---|
title | string | ✅ | Titel der Nachricht |
message | string | ✅ | Text der Nachricht |
application_id | string | ❌ | TID der Anwendung |
device_id | string | ❌ | TID des Geräts |
is_read | boolean | ❌ | Als gelesen/ungelesen markieren |
Beispielanfrage
bash
curl -X PUT "https://api.pocketalert.app/v1/messages/jb4xw9elz24c5" \
-H "Token: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"title": "Updated Title",
"message": "Updated message content",
"is_read": true
}'javascript
const tid = 'jb4xw9elz24c5';
const response = await fetch(`https://api.pocketalert.app/v1/messages/${tid}`, {
method: 'PUT',
headers: {
'Token': 'your-api-key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
title: 'Updated Title',
message: 'Updated message content',
is_read: true
})
});python
import requests
tid = 'jb4xw9elz24c5'
response = requests.put(
f'https://api.pocketalert.app/v1/messages/{tid}',
headers={'Token': 'your-api-key'},
json={
'title': 'Updated Title',
'message': 'Updated message content',
'is_read': True
}
)
print(response.json())php
$tid = 'jb4xw9elz24c5';
$response = Http::withHeaders([
'Token' => 'your-api-key',
])->put('https://api.pocketalert.app/v1/messages/'.$tid, [
'title' => 'Updated Title',
'message' => 'Updated message content',
'is_read' => true,
]);
return $response->json();Antwort
Erfolgreiche Antwort
200 OK
Nachricht erfolgreich aktualisiert
json
{
"data": "success"
}Fehlerantworten
| Status | Beschreibung |
|---|---|
401 | Nicht autorisiert — Token ungültig oder fehlt |
404 | Nicht gefunden — Nachricht existiert nicht |
400 | Ungültige Anfrage — fehlerhafter Request-Body |