전송 기록 목록
GET /v1/webhooks/deliveries
인증된 사용자의 최근 웹훅 전송 시도를 조회합니다. 가장 최근 순으로 전송 로그를 반환하므로 웹훅이 이벤트를 성공적으로 수신하고 있는지 모니터링할 수 있습니다.
사용해 보기
이 엔드포인트를 Swagger UI에서 대화형으로 테스트할 수 있습니다.
인증 필요
Authorization 헤더에 API 키를 포함하세요.
요청
헤더
| 헤더 | 값 | 필수 |
|---|---|---|
Authorization | Bearer <token> | 예 |
쿼리 파라미터
| 파라미터 | 타입 | 기본값 | 설명 |
|---|---|---|---|
webhookId | string | -- | 특정 웹훅 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 | 웹훅을 소유한 사용자의 ID. |
webhookId | string | 대상 웹훅의 ID. |
extractionId | string | 이 전송을 트리거한 추출의 ID. |
event | string | 이벤트 이름: extraction.completed 또는 extraction.failed. |
url | string | 전송 시점의 웹훅 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 키 / 토큰. |
