# Anwendung abrufen (GET)

Ruf die Details einer bestimmten Anwendung über ihre eindeutige Kennung ab.

## Endpunkt

```
GET https://api.pocketalert.app/v1/applications/{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 | Erforderlich | Beschreibung |
|-----------|-----|:------------:|--------------|
| `tid` | string | ✅ | Eindeutige Kennung der Anwendung |

### Header

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

### Beispielanfrage

**cURL**

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

**JavaScript**

```javascript
const tid = 'sozb3yswlwoqdd1l1msi1nnh';

const response = await fetch(`https://api.pocketalert.app/v1/applications/${tid}`, {
  headers: {
    'Token': 'your-api-key'
  }
});

const application = await response.json();
console.log(application);
```

**Python**

```python
import requests

tid = 'sozb3yswlwoqdd1l1msi1nnh'

response = requests.get(
    f'https://api.pocketalert.app/v1/applications/{tid}',
    headers={'Token': 'your-api-key'}
)

print(response.json())
```

**PHP**

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

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

## Antwort

### Erfolgreiche Antwort

> **Tip: 200 OK**
>
> Gibt das Anwendungsobjekt zurück

| Feld | Typ | Beschreibung |
|------|-----|--------------|
| `tid` | string | Eindeutige Kennung der Anwendung |
| `name` | string | Name der Anwendung |
| `is_active` | boolean | Ob die Anwendung aktiv ist |
| `created_at` | string | Zeitstempel der Erstellung |

```json
{
  "tid": "sozb3yswlwoqdd1l1msi1nnh",
  "name": "Production Monitoring",
  "is_active": true,
  "created_at": "18.09.2023 02:29:02"
}
```

### Fehlerantworten

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