# Webhook abrufen (GET)

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

## Endpoint

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

## Authentifizierung

> **Info: Erforderlich**
>
> Füge einen dieser Header in deine Anfrage ein:
> - `Token: <your-api-key>` — Hol ihn dir unter [API-Schlüssel](https://pocketalert.app/account/apikeys)
> - `Authorization: Bearer <jwt-token>` — Aus [Anmeldung](https://info.pocketalert.app/api/user/login.md)

## Anfrage

### Pfadparameter

| Parameter | Typ | Pflicht | Beschreibung |
|-----------|-----|:-------:|--------------|
| `tid` | string | ✅ | Eindeutige ID des Webhooks |

### Header

| Header | Pflicht | Beschreibung |
|--------|:-------:|--------------|
| `Token` | ✅ | Dein API-Schlüssel |
| `Authorization` | ✅ | `Bearer <jwt-token>` |

### Beispielanfrage

**cURL**

```bash
curl -X GET "https://api.pocketalert.app/v1/webhooks/kblf7mh9j8jjyeh4fx" \
  -H "Token: your-api-key"
```

**JavaScript**

```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**

```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**

```php
$tid = 'kblf7mh9j8jjyeh4fx';
$response = Http::withHeaders([
    'Token' => 'your-api-key',
])->get('https://api.pocketalert.app/v1/webhooks/'.$tid);

return $response->json();
```

## Antwort

### Erfolgreiche Antwort

> **Tip: 200 OK**
>
> Gibt das Webhook-Objekt zurück

| Feld | Typ | Beschreibung |
|------|-----|--------------|
| `tid` | string | Eindeutige ID des Webhooks |
| `name` | string | Name des Webhooks |
| `url` | string | URL-Slug des Webhooks |
| `message` | string | Nachrichtenvorlage |
| `is_active` | boolean | Ob der Webhook aktiv ist |
| `created_at` | string | Zeitstempel 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

| Status | Beschreibung |
|:------:|--------------|
| `401` | Nicht autorisiert — Token ungültig oder fehlt |
| `404` | Nicht gefunden — Webhook existiert nicht |
