# Ottieni tutte le applicazioni (GET)

Recupera l'elenco di tutte le applicazioni del tuo account.

## Endpoint

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

## Autenticazione

> **Info: Obbligatoria**
>
> Includi una di queste intestazioni nella tua richiesta:
> - `Token: <your-api-key>` — Ottienila da [Chiavi API](https://pocketalert.app/account/apikeys)
> - `Authorization: Bearer <jwt-token>` — Da [Accedi](https://info.pocketalert.app/api/user/login.md)

## Richiesta

### Intestazioni

| Intestazione | Obbligatoria | Descrizione |
|--------------|:------------:|-------------|
| `Token` | ✅ | La tua chiave API |
| `Authorization` | ✅ | `Bearer <jwt-token>` |

<small>* È richiesta una delle due intestazioni `Token` o `Authorization`</small>

### Esempio di richiesta

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

## Risposta

### Risposta di successo

> **Tip: 200 OK**
>
> Restituisce un array di oggetti applicazione

| Campo | Tipo | Descrizione |
|-------|------|-------------|
| `tid` | string | Identificatore univoco dell'applicazione |
| `name` | string | Nome dell'applicazione |
| `is_active` | boolean | Indica se l'applicazione è attiva |
| `created_at` | string | Data e ora di creazione |

```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"
  }
]
```

### Risposte di errore

| Stato | Descrizione |
|:-----:|-------------|
| `401` | Non autorizzato — Token non valido o mancante |
| `429` | Limite di richieste superato — Troppe richieste |
