Zum Inhalt springen

Webhook abrufen GET ​

Ruf die Details eines bestimmten Webhooks anhand seiner eindeutigen ID ab.

Endpoint ​

GET https://api.pocketalert.app/v1/webhooks/{tid}

Authentifizierung ​

Erforderlich

Füge einen dieser Header in deine Anfrage ein:

Anfrage ​

Pfadparameter ​

ParameterTypPflichtBeschreibung
tidstring✅Eindeutige ID des Webhooks
HeaderPflichtBeschreibung
Token✅Dein API-Schlüssel
Authorization✅Bearer <jwt-token>

Beispielanfrage ​

bash
curl -X GET "https://api.pocketalert.app/v1/webhooks/kblf7mh9j8jjyeh4fx" \
  -H "Token: your-api-key"
javascript
const tid = 'kblf7mh9j8jjyeh4fx';
const response = await fetch(`https://api.pocketalert.app/v1/webhooks/${tid}`, {
  headers: { 'Token': 'your-api-key' }
});
const webhook = await response.json();
python
import requests

tid = 'kblf7mh9j8jjyeh4fx'
response = requests.get(
    f'https://api.pocketalert.app/v1/webhooks/{tid}',
    headers={'Token': 'your-api-key'}
)
print(response.json())
php
$tid = 'kblf7mh9j8jjyeh4fx';
$response = Http::withHeaders([
    'Token' => 'your-api-key',
])->get('https://api.pocketalert.app/v1/webhooks/'.$tid);

return $response->json();

Antwort ​

Erfolgreiche Antwort ​

200 OK

Gibt das Webhook-Objekt zurück

FeldTypBeschreibung
tidstringEindeutige ID des Webhooks
namestringName des Webhooks
urlstringURL-Slug des Webhooks
messagestringNachrichtenvorlage
is_activebooleanOb der Webhook aktiv ist
created_atstringZeitstempel der Erstellung
json
{
  "tid": "kblf7mh9j8jjyeh4fx",
  "name": "GitHub Push",
  "url": "cs994rqfkk8ljngt",
  "message": "Push to %repository.name%: %head_commit.message%",
  "is_active": true,
  "created_at": "01.09.2023 22:38:48"
}

Fehlerantworten ​

StatusBeschreibung
401Nicht autorisiert — Token ungültig oder fehlt
404Nicht gefunden — Webhook existiert nicht

Pocket Alert Dokumentation