# Get All Applications (GET)

Ambil daftar semua aplikasi di akun Anda.

## Endpoint

```
GET https://api.pocketalert.app/v1/applications
```

## Authentication

> **Info: Required**
>
> 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)

## Request

### Headers

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

<small>* Salah satu dari `Token` atau `Authorization` wajib diisi</small>

### Example Request

**cURL**

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

**JavaScript**

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

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

**Python**

```python
import requests

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

print(response.json())
```

**PHP**

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

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

## Response

### Success Response

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

| Field | Type | Description |
|-------|------|-------------|
| `tid` | string | Pengenal unik aplikasi |
| `name` | string | Nama aplikasi |
| `is_active` | boolean | Apakah aplikasi aktif |
| `created_at` | string | Waktu pembuatan |

```json
[
  {
    "tid": "sozb3yswlwoqdd1l1msi1nnh",
    "name": "Production Monitoring",
    "is_active": true,
    "created_at": "18.09.2023 02:31:32"
  },
  {
    "tid": "zah97tnq4re45ych91byjzwa",
    "name": "Development Alerts",
    "is_active": true,
    "created_at": "18.09.2023 02:31:14"
  }
]
```

### Error Responses

| Status | Description |
|:------:|-------------|
| `401` | Unauthorized — Token tidak valid atau tidak ada |
| `429` | Rate Limited — Terlalu banyak permintaan |
