ペイロード構造
Webhookと連携に送信されるJSONペイロード構造を理解しましょう。
基本ペイロード
すべてのWebhookペイロードにはこれらの基本フィールドが含まれます。本、セッション、本棚オブジェクトはイベントタイプに応じて含まれます。
{
"eventType": "session.completed",
"timestamp": "2024-12-04T10:30:00Z",
"book": { ... },
"session": { ... },
"shelf": null,
"metadata": null
}eventTypeこの通知をトリガーしたイベントのタイプ(例:session.completed)timestampイベントが発生したときのISO 8601形式のタイムスタンプmetadataオプションの追加データ(現在はnull、将来の使用のために予約)本オブジェクト
本関連のイベントとセッションイベントに含まれます。本の詳細が含まれます。
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"title": "The Great Gatsby",
"authors": ["F. Scott Fitzgerald"],
"pages": 180,
"currentPage": 180,
"status": "finished",
"isbn": "9780743273565",
"progressPercentage": 100
}| フィールド | タイプ | 説明 |
|---|---|---|
id | string | 本の一意の識別子(UUID) |
title | string | 本のタイトル |
authors | string[] | 著者名の配列 |
pages | number | 本の総ページ数 |
currentPage | number | 現在の読書位置(ページ番号) |
status | string | 読書ステータス(to_read, reading, finished, abandoned) |
isbn | string? | 利用可能な場合のISBN番号(オプション) |
progressPercentage | number | 読書進捗のパーセンテージ(0-100) |
セッションオブジェクト
セッションイベントに含まれます。読書セッションの詳細が含まれます。
{
"id": "660e8400-e29b-41d4-a716-446655440001",
"startedAt": "2024-12-04T10:05:00Z",
"endedAt": "2024-12-04T10:30:00Z",
"status": "completed",
"durationMinutes": 25,
"pagesRead": 42
}| フィールド | タイプ | 説明 |
|---|---|---|
id | string | セッションの一意の識別子(UUID) |
startedAt | string | セッション開始時のISO 8601タイムスタンプ |
endedAt | string? | セッション終了時のISO 8601タイムスタンプ(アクティブな場合はnull) |
status | string | セッションステータス(active, paused, completed) |
durationMinutes | number | セッションの継続時間(分) |
pagesRead | number | このセッション中に読んだページ数 |
本棚オブジェクト
本棚関連のイベントに含まれます。本棚の詳細が含まれます。
{
"id": "770e8400-e29b-41d4-a716-446655440002",
"name": "Favorites",
"icon": "star.fill",
"bookCount": 12
}| フィールド | タイプ | 説明 |
|---|---|---|
id | string | 本棚の一意の識別子(UUID) |
name | string | 本棚の名前 |
icon | string? | 本棚アイコンのSFシンボル名(オプション) |
bookCount | number | この本棚にある本の数 |
ステータス値
本のステータス
to_readreadingfinishedabandoned
セッションステータス
activepausedcompleted