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

# チャネル QR セッションの取得

> Channel の QR 認可セッションをポーリングします。

`GET /api/v1/forward/qr_sessions/{session_key}`

QR 認可セッションの現在のステータスを返します。

## Headers

| Header          | Required | Description    |
| --------------- | -------- | -------------- |
| `Authorization` | Yes      | `Bearer <PAT>` |

## Path parameters

| Parameter     | Type   | Required | Description                                   |
| ------------- | ------ | -------- | --------------------------------------------- |
| `session_key` | string | Yes      | Create Channel QR Session が返す不透明な QR セッションキー。 |

## Example request

```bash theme={null}
curl -s -X GET 'https://api.qoder.com/api/v1/forward/qr_sessions/qr-a1b2c3d4' \
  -H "Authorization: Bearer $QODER_PAT"
```

## Example response

**HTTP 200 OK**

```json theme={null}
{
  "session_key": "qr-a1b2c3d4",
  "channel_id": "channel_dingtalk-001",
  "channel_type": "dingtalk",
  "status": "confirmed",
  "expires_at": "2026-06-18T10:05:00Z",
  "err_code": null,
  "err_msg": null
}
```

## Status values

| Status      | Description                                                  |
| ----------- | ------------------------------------------------------------ |
| `waiting`   | スキャン、認可、インストール、または設定を待機しています。                                |
| `scanned`   | QR コードがスキャンされ、モバイルでの確認を待機しています。                              |
| `confirmed` | アクティベーションに成功しました。Channel の `binding_status` が `bound` になります。 |
| `expired`   | QR セッションの有効期限が切れました。新しい QR セッションを作成してください。                   |
| `denied`    | ユーザーが認可を拒否したか、インストールをキャンセルしました。                              |
| `error`     | サードパーティチャネルが回復不能なエラーを返しました。                                  |

## Errors

| HTTP | Type                   | Code                           | Trigger                                |
| ---- | ---------------------- | ------------------------------ | -------------------------------------- |
| 401  | `authentication_error` | `authentication_required`      | PAT が無効または期限切れです。                      |
| 404  | `not_found_error`      | `channel_qr_session_not_found` | QR セッションが存在しない、期限切れ、または呼び出し元から参照できません。 |

## Notes

* `session_key` は短時間有効な不透明なポーリング用の認証情報です。
* create レスポンスで返された `poll_interval_seconds` の間隔でポーリングしてください。
* `confirmed` になった後は、Channel の詳細を再取得してください。

## Related

<CardGroup cols={2}>
  <Card title="チャネル QR セッションの作成" icon="qrcode" href="/cloud-agents/api/forward/channels/create-qr-session" />

  <Card title="チャネルの取得" icon="file-lines" href="/cloud-agents/api/forward/channels/get" />
</CardGroup>
