# Mulai Cepat

Mulai menggunakan PocketAlert dalam hitungan menit. Panduan ini akan memandu Anda mengirim push notification pertama Anda.

## Prasyarat

- Akun PocketAlert — [Daftar](https://pocketalert.app/signup) atau [Masuk](https://pocketalert.app/signin)
- Aplikasi seluler PocketAlert terpasang di perangkat Anda

---

## Langkah 1: Dapatkan Kunci API Anda

1. Masuk ke [PocketAlert](https://pocketalert.app/signin)
2. Buka [Kunci API](https://pocketalert.app/account/apikeys)
3. Klik **Buat Kunci Baru**
4. Salin dan simpan kunci API Anda dengan aman

> **Warning: Penting**
>
> Kunci API Anda hanya ditampilkan sekali. Simpan di tempat yang aman.

---

## Langkah 2: Kirim Notifikasi Pertama Anda

Pilih metode yang Anda inginkan:

**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)
}
```

---

## Langkah 3: Periksa Respons

Permintaan yang berhasil akan mengembalikan:

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

| Field | Deskripsi |
|-------|-------------|
| `tid` | Pengenal unik pesan |
| `title` | Judul notifikasi Anda |
| `message` | Isi notifikasi Anda |
| `created_at` | Waktu pesan dikirim |

---

## Selanjutnya?

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

**Jelajahi fitur lainnya:**

- [Buat Aplikasi](https://info.pocketalert.app/api/applications/create.md) — Atur pesan berdasarkan proyek
- [Kelola Perangkat](https://info.pocketalert.app/api/devices/get-devices.md) — Kirim ke perangkat tertentu
- [Atur Webhook](https://info.pocketalert.app/api/webhooks/create.md) — Terima peringatan dari layanan eksternal
- [Gunakan CLI](https://info.pocketalert.app/cli.md) — Kirim notifikasi dari terminal Anda

</div>

---

## Butuh Bantuan?

Untuk bantuan lebih lanjut atau untuk berbagi kasus penggunaan Anda:

| Sumber | Tautan |
|----------|------|
| Dukungan Email | [support@pocketalert.app](mailto:support@pocketalert.app) |
| Referensi API | [Dokumentasi Lengkap](https://info.pocketalert.app/intro.md) |
| Alat CLI | [Unduh & Pasang](https://info.pocketalert.app/cli.md) |
