قائمة عمليات التسليم
GET /v1/webhooks/deliveries
قائمة محاولات تسليم خطافات الويب الأخيرة للمستخدم المصادق عليه. تُرجع سجلات التسليم مرتبة من الأحدث أولاً، حتى تتمكن من مراقبة ما إذا كانت خطافات الويب الخاصة بك تتلقى الأحداث بنجاح.
جرّبه
اختبر هذا الـ endpoint بشكل تفاعلي في Swagger UI.
المصادقة مطلوبة
أدرج مفتاح API في ترويسة Authorization.
الطلب
الترويسات
| الترويسة | القيمة | مطلوب |
|---|---|---|
Authorization | Bearer <token> | نعم |
معاملات الاستعلام
| المعامل | النوع | الافتراضي | الوصف |
|---|---|---|---|
webhookId | string | -- | تصفية عمليات التسليم حسب معرّف خطاف ويب محدد. |
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 | معرّف المستخدم الذي يملك خطاف الويب. |
webhookId | string | معرّف خطاف الويب المستهدف. |
extractionId | string | معرّف الاستخراج الذي أطلق هذا التسليم. |
event | string | اسم الحدث: extraction.completed أو extraction.failed. |
url | string | عنوان URL لخطاف الويب وقت التسليم. |
status | string | success إذا أرجعت نقطة النهاية حالة 2xx، 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 / رمز مفقود أو غير صالح أو منتهي الصلاحية. |
