> ## Documentation Index
> Fetch the complete documentation index at: https://gowa-docs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# クイックスタート

> GOWAを実行し、WhatsAppアカウントをペアリングし、数分で最初のメッセージを送信します。

## 1. サーバーを起動

> [tab] Docker
>
> ```bash theme={null}
> docker run -d --name gowa \
>   -p 3000:3000 \
>   -v gowa_storages:/app/storages \
>   -v gowa_statics:/app/statics \
>   -e APP_BASIC_AUTH=admin:changeme \
>   aldinokemal2104/go-whatsapp-web-multidevice:latest
> ```
>
> 画像のデフォルトコマンドは `rest` なので引数は必要ありません。同じ画像は `ghcr.io/aldinokemal/go-whatsapp-web-multidevice` として公開されます。

> [tab] バイナリ
>
> [Latest stable release](https://github.com/aldinokemal/go-whatsapp-web-multidevice/releases/latest) からあなたのプラットフォームのアーカイブをダウンロードしてください。 この例では、v9.9.0 Linux amd64 アーカイブを使用します。ダウンロードしたファイル名を置き換えます。
>
> ```bash theme={null}
> unzip whatsapp_9.9.0_linux_amd64.zip
> chmod +x whatsapp
> ./whatsapp rest --basic-auth=admin:changeme
> ```
>
> 最初にFFmpegとlibwebp(`cwebp`)をインストールします。GOWAはメディア変換に使用します。

> [tab] ソースから
>
> Go 1.26+、FFmpegとlibwebpが必要です。
>
> ```bash theme={null}
> git clone https://github.com/aldinokemal/go-whatsapp-web-multidevice.git
> cd go-whatsapp-web-multidevice/src
> go run . rest --basic-auth=admin:changeme
> ```

アップしているか確認:

```bash theme={null}
curl http://localhost:3000/health
# OK
```

> [!NOTE]
>
> デフォルトのループバックリスナーでは、完全な `APP_BASIC_AUTH` 資格情報が必要です。未認証のローカル開発では、`APP_HOST=127.0.0.1` 認証リバース・プロキシは明示的に `APP_ALLOW_UNAUTHENTICATED=true` オーバーライドを使用できます。 [authentication](https://gowa-docs.mintlify.site/ja/authentication.md) を参照してください。

## 2. デバイスを作成

それぞれのWhatsAppアカウントはデバイススロットにあります。1つ作成し、再利用するIDを与えます:

```bash theme={null}
curl -u admin:changeme -X POST http://localhost:3000/devices \
  -H "Content-Type: application/json" \
  -d '{"device_id": "my-device"}'
```

生成された UUID を得るには `device_id` を省略してください。

## 3. アカウントをペアリングする

> [tab] QR code
>
> ```bash theme={null}
> curl -u admin:changeme http://localhost:3000/devices/my-device/login
> ```
>
> ブラウザーで `results.qr_link` を開き、WhatsApp → **リンクされたデバイス** → **デバイスをリンク**からスキャンします。 `results.qr_duration` 秒後に有効期限が切れます。実行が終わった場合は新しいコードをリクエストします。

> [tab] Pairing code
>
> ```bash theme={null}
> curl -u admin:changeme -X POST \
>   "http://localhost:3000/devices/my-device/login/code?phone=628123456789"
> ```
>
> **リンクされたデバイス** → **電話番号**にリンク\*\*の下に電話番号に`results.pair_code`を入力します。

> [tab] ダッシュボード
>
> `http://localhost:3000/`を開き、ブラウザーが求めるときにベーシック認証情報を入力し、UIからデバイスをペアリングします。

デバイスがログインしていることを確認します(`results.is_logged_in`は`true`にする必要があります):

```bash theme={null}
curl -u admin:changeme http://localhost:3000/devices/my-device/status
```

## 4. メッセージを送信

```bash theme={null}
curl -u admin:changeme -X POST http://localhost:3000/send/message \
  -H "Content-Type: application/json" \
  -H "X-Device-Id: my-device" \
  -d '{"phone": "628123456789", "message": "Hello from GOWA"}'
```

```json theme={null}
{
  "code": "SUCCESS",
  "message": "Success",
  "results": {
    "message_id": "3EB0B430B6F8F1D0E053AC120E0A9E5C",
    "status": "Message sent to 628123456789 (server timestamp: ...)"
  }
}
```

`phone` は国コードで数字を取り、`+` やスペースなし、`628123456789@s.whatsapp.net` または `120363025246125486@g.us` 。登録されているデバイスは 1 つだけで、`X-Device-Id` はオプションです。

## 5. メッセージを受信する

WebhookのURLで再起動すると、GOWAはすべてのイベントをPOSTします:

```bash theme={null}
export WHATSAPP_WEBHOOK_SECRET="$(openssl rand -hex 32)"
./whatsapp rest --basic-auth=admin:changeme --webhook=https://example.com/wa-hook
```

生成された webhook シークレットを保存し、受信者に同じ値を設定します。 再起動後に再利用します。ペイロードと署名チェックについては、 [Webhooks](https://gowa-docs.mintlify.site/ja/concepts/webhooks.md) を参照してください。

## 次のステップ

> [card] [インストール](https://gowa-docs.mintlify.site/ja/installation.md)
>
> Docker Compose、リバースプロキシ、PostgreSQL。

> [card] [構成の参照](https://gowa-docs.mintlify.site/ja/configuration.md)
>
> 各フラグと環境変数。

> [card] [マルチデバイス](https://gowa-docs.mintlify.site/ja/concepts/multidevice.md)
>
> 1つのサーバーで複数のアカウントを実行します。

> [card] [API リファレンス](https://gowa-docs.mintlify.site/ja/api-reference/introduction.md)
>
> すべてのエンドポイント。


## Related topics

- [GOWA: WhatsApp REST API](https://gowa-docs.mintlify.site/ja/index.md)
- [スターメッセージ](https://gowa-docs.mintlify.site/ja/api-reference/message/スターメッセージ.md)
- [Chatwoot統合](https://gowa-docs.mintlify.site/ja/integrations/chatwoot.md)
- [メディア処理](https://gowa-docs.mintlify.site/ja/examples/media-handling.md)
- [ニュースレターのライブ更新を購読する](https://gowa-docs.mintlify.site/ja/api-reference/newsletter/ニュースレターのライブ更新を購読する.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.