コンテンツへスキップ

クイックスタート ​

Pocket Alert を数分で使い始められます。このガイドでは、最初のプッシュ通知を送信するまでの手順を説明します。

前提条件 ​

  • Pocket Alert アカウント — 新規登録またはログイン
  • デバイスに Pocket Alert モバイルアプリをインストール済みであること

ステップ 1: API キーを取得する ​

  1. Pocket Alert にログインします
  2. API キーにアクセスします
  3. 新しいキーを作成 をクリックします
  4. API キーをコピーして、安全な場所に保存します

重要

API キーは一度だけ表示されます。安全な場所に保管してください。


ステップ 2: 最初の通知を送信する ​

お好みの方法を選択してください:

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
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
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
$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
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)
}

ステップ 3: レスポンスを確認する ​

リクエストが成功すると、次のレスポンスが返されます:

json
{
  "tid": "cq4k7rml9m2qqmuw44ypoos93",
  "title": "Hello from API",
  "message": "This is my first notification!",
  "application": "",
  "device": "",
  "created_at": "18.01.2026 15:30:00"
}
フィールド説明
tidメッセージの一意の識別子
title通知のタイトル
message通知の本文
created_atメッセージが送信された日時

次のステップ ​

その他の機能を見てみましょう:


サポートが必要ですか? ​

さらにサポートが必要な場合や、ユースケースを共有したい場合は、以下をご利用ください:

リソースリンク
メールサポート[email protected]
API リファレンスドキュメント全体
CLI ツールダウンロードとインストール

Pocket Alert ドキュメント