配信一覧
GET /v1/webhooks/deliveries
認証済みユーザーの最近のWebhook配信試行を一覧表示します。最新のものから順に配信ログが返されるため、Webhookが正常にイベントを受信しているかどうかを監視できます。
試してみる
このエンドポイントを Swagger UI でインタラクティブにテストできます。
認証が必要です
Authorization ヘッダーにAPIキーを含めてください。
リクエスト
ヘッダー
| ヘッダー | 値 | 必須 |
|---|---|---|
Authorization | Bearer <token> | はい |
クエリパラメータ
| パラメータ | 型 | デフォルト | 説明 |
|---|---|---|---|
webhookId | string | — | 特定のWebhook IDで配信をフィルタリング。 |
limit | number | 50 | 返す結果の最大数(1〜100)。 |
コード例
bash
curl "https://api.docmap.io/v1/webhooks/deliveries?limit=10" \
-H "Authorization: Bearer dm_live_abc123def456ghi789jkl012mno345"typescript
const apiKey = process.env.DOCMAP_API_KEY
const response = await fetch(
'https://api.docmap.io/v1/webhooks/deliveries?limit=10',
{ headers: { 'Authorization': `Bearer ${apiKey}` } },
)
const { data } = await response.json()
for (const delivery of data) {
console.log(`${delivery.event} → ${delivery.url} — ${delivery.status} (${delivery.durationMs}ms)`)
}python
import requests
api_key = "dm_live_abc123def456ghi789jkl012mno345"
response = requests.get(
"https://api.docmap.io/v1/webhooks/deliveries",
headers={"Authorization": f"Bearer {api_key}"},
params={"limit": 10},
)
deliveries = response.json()["data"]
for d in deliveries:
print(f"{d['event']} → {d['url']} — {d['status']} ({d['durationMs']}ms)")レスポンス
ステータス: 200 OK
レスポンスボディには、配信ログオブジェクトの data 配列が含まれています。
フィールド
配列内の各オブジェクトには以下が含まれます:
| フィールド | 型 | 説明 |
|---|---|---|
id | string | 配信レコードの一意の識別子。 |
userId | string | Webhookを所有するユーザーのID。 |
webhookId | string | 対象となったWebhookのID。 |
extractionId | string | この配信をトリガーした抽出のID。 |
event | string | イベント名: extraction.completed または extraction.failed。 |
url | string | 配信時点のWebhook URL。 |
status | string | エンドポイントが2xxステータスを返した場合は success、それ以外は failed。 |
httpStatus | number | null | HTTPレスポンスステータスコード。レスポンスを受信する前にリクエストが失敗した場合(例:ネットワークエラー、タイムアウト)は null。 |
error | string | null | 配信が失敗した場合のエラーメッセージ。成功時は null。 |
durationMs | number | 配信試行のラウンドトリップ時間(ミリ秒)。 |
createdAt | string | 配信が試行されたISO 8601タイムスタンプ。 |
例
json
{
"data": [
{
"id": "abc123def456",
"userId": "uid_a1b2c3d4e5f6",
"webhookId": "webhook-abc123def456",
"extractionId": "extract-xyz789",
"event": "extraction.completed",
"url": "https://your-app.com/webhooks/docmap",
"status": "success",
"httpStatus": 200,
"error": null,
"durationMs": 342,
"createdAt": "2025-01-20T14:30:04.000Z"
},
{
"id": "def456ghi789",
"userId": "uid_a1b2c3d4e5f6",
"webhookId": "webhook-abc123def456",
"extractionId": "extract-uvw456",
"event": "extraction.failed",
"url": "https://your-app.com/webhooks/docmap",
"status": "failed",
"httpStatus": null,
"error": "The operation was aborted due to timeout",
"durationMs": 10003,
"createdAt": "2025-01-20T12:15:00.000Z"
}
]
}エラー
| ステータス | コード | 説明 |
|---|---|---|
401 | UNAUTHORIZED | APIキー/トークンが欠落、無効、または期限切れです。 |
