# Avvio rapido

Inizia a usare PocketAlert in pochi minuti. Questa guida ti accompagna nell'invio della tua prima notifica push.

## Prerequisiti

- Un account PocketAlert — [Registrati](https://pocketalert.app/signup) oppure [Accedi](https://pocketalert.app/signin)
- L'app mobile PocketAlert installata sul tuo dispositivo

---

## Passo 1: ottieni la tua chiave API

1. Accedi a [PocketAlert](https://pocketalert.app/signin)
2. Vai su [Chiavi API](https://pocketalert.app/account/apikeys)
3. Clicca su **Crea nuova chiave**
4. Copia e salva la tua chiave API in un posto sicuro

> **Warning: Importante**
>
> La tua chiave API viene mostrata una sola volta. Conservala in un luogo sicuro.

---

## Passo 2: invia la tua prima notifica

Scegli il metodo che preferisci:

**cURL**

```bash
curl -X POST "https://api.pocketalert.app/v1/messages" \
  -H "Token: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Hello from API",
    "message": "This is my first notification!"
  }'
```

**JavaScript**

```javascript
const response = await fetch('https://api.pocketalert.app/v1/messages', {
  method: 'POST',
  headers: {
    'Token': 'YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    title: 'Hello from API',
    message: 'This is my first notification!'
  })
});

const data = await response.json();
console.log('Message sent:', data.tid);
```

**Python**

```python
import requests

response = requests.post(
    'https://api.pocketalert.app/v1/messages',
    headers={
        'Token': 'YOUR_API_KEY',
        'Content-Type': 'application/json'
    },
    json={
        'title': 'Hello from API',
        'message': 'This is my first notification!'
    }
)

print('Message sent:', response.json()['tid'])
```

**PHP**

```php
$response = Http::withHeaders([
    'Token' => 'YOUR_API_KEY',
])->post('https://api.pocketalert.app/v1/messages', [
    'title' => 'Hello from API',
    'message' => 'This is my first notification!',
]);

echo 'Message sent: ' . $response['tid'];
```

**Go**

```go
package main

import (
    "bytes"
    "encoding/json"
    "net/http"
)

func main() {
    payload := map[string]string{
        "title":   "Hello from API",
        "message": "This is my first notification!",
    }
    body, _ := json.Marshal(payload)

    req, _ := http.NewRequest("POST", 
        "https://api.pocketalert.app/v1/messages", 
        bytes.NewBuffer(body))
    req.Header.Set("Token", "YOUR_API_KEY")
    req.Header.Set("Content-Type", "application/json")

    client := &http.Client{}
    client.Do(req)
}
```

---

## Passo 3: controlla la risposta

Una richiesta andata a buon fine restituisce:

```json
{
  "tid": "cq4k7rml9m2qqmuw44ypoos93",
  "title": "Hello from API",
  "message": "This is my first notification!",
  "application": "",
  "device": "",
  "created_at": "18.01.2026 15:30:00"
}
```

| Campo | Descrizione |
|-------|-------------|
| `tid` | Identificatore univoco del messaggio |
| `title` | Il titolo della tua notifica |
| `message` | Il corpo della tua notifica |
| `created_at` | Data e ora di invio del messaggio |

---

## Cosa c'è dopo?

<div class="tip custom-block" style="padding-top: 8px">

**Scopri altre funzionalità:**

- [Crea applicazioni](https://info.pocketalert.app/api/applications/create.md) — Organizza i messaggi per progetto
- [Gestisci dispositivi](https://info.pocketalert.app/api/devices/get-devices.md) — Invia a dispositivi specifici
- [Configura i webhook](https://info.pocketalert.app/api/webhooks/create.md) — Ricevi avvisi da servizi esterni
- [Usa la CLI](https://info.pocketalert.app/cli.md) — Invia notifiche dal tuo terminale

</div>

---

## Hai bisogno di aiuto?

Per ulteriore assistenza o per condividere i tuoi casi d’uso:

| Risorsa | Link |
|----------|------|
| Supporto via email | [support@pocketalert.app](mailto:support@pocketalert.app) |
| Riferimento API | [Documentazione completa](https://info.pocketalert.app/intro.md) |
| Strumento CLI | [Scarica e installa](https://info.pocketalert.app/cli.md) |
