# Get Application (GET)

Ambil detail aplikasi tertentu berdasarkan identifier unik-nya.

## Endpoint

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

## Autentikasi

> **Info: Wajib**
>
> Sertakan salah satu header berikut dalam permintaan Anda:
> - `Token: <your-api-key>` — Dapatkan dari [API Keys](https://pocketalert.app/account/apikeys)
> - `Authorization: Bearer <jwt-token>` — Dari [Login](https://info.pocketalert.app/api/user/login.md)

## Permintaan

### Path Parameters

| Parameter | Type | Required | Description |
|-----------|------|:--------:|-------------|
| `tid` | string | ✅ | Identifier unik aplikasi |

### Headers

| Header | Required | Description |
|--------|:--------:|-------------|
| `Token` | ✅ | Kunci API Anda |
| `Authorization` | ✅ | `Bearer <jwt-token>` |

### Contoh Permintaan

**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();
```

## Respons

### Respons Sukses

> **Tip: 200 OK**
>
> Mengembalikan objek aplikasi

| Field | Type | Description |
|-------|------|-------------|
| `tid` | string | Identifier unik aplikasi |
| `name` | string | Nama aplikasi |
| `is_active` | boolean | Apakah aplikasi aktif |
| `created_at` | string | Stempel waktu pembuatan |

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

### Respons Error

| Status | Description |
|:------:|-------------|
| `401` | Unauthorized — Token tidak valid atau tidak ada |
| `404` | Not Found — Aplikasi tidak ditemukan |
