# ส่งซ้ำข้อความที่ส่งไม่สำเร็จตามช่วงเวลา

Source: https://checkslip.com/docs/recover-endpoint

POST `https://api.checkslip.com/api/webhooks/endpoints/{endpoint_id}/recover`

ใช้ API key

ใช้หลังระบบของคุณล่ม · ส่งซ้ำทุกรายการส่งของ endpoint นี้ที่เป็น FAILED (ส่งไม่สำเร็จ) และสร้างตั้งแต่ since จนถึงก่อน until (ไม่ส่ง until คือถึงตอนนี้) · ส่งด้วย webhook-id เดิม ระบบที่กันซ้ำด้วย webhook-id จะไม่บันทึกซ้ำ · ช่วงยาวได้ไม่เกิน 14 วัน และย้อนได้ไม่เกิน 30 วัน (RECOVER_WINDOW_INVALID) · งานทำเบื้องหลัง คำตอบไม่บอกจำนวน ติดตามได้จากรายการส่งของ endpoint นี้ที่เป็น RETRYING (รอส่งอีกรอบ) · endpoint ที่ปิดอยู่ต้องเปิดก่อน (ENDPOINT_DISABLED) · ต้องส่ง header Idempotency-Key · ใช้ API key ที่มีสิทธิ์ webhook:manage

## Parameters

| ฟิลด์ | ส่งทาง | ชนิด | จำเป็น |
| --- | --- | --- | --- |
| `endpoint_id` | path | `string` | ใช่ |
| `traceparent` | header | `string` | ไม่ |
| `Idempotency-Key` | header | `string` | ใช่ |

## Request body

`application/json`

| ฟิลด์ | ชนิด | จำเป็น |
| --- | --- | --- |
| `since` | `string (date-time)` | ใช่ |
| `until` | `string (date-time)` | ไม่ |

## Responses

### 202 `application/json`

| ฟิลด์ | ชนิด | จำเป็น |
| --- | --- | --- |
| `endpoint_id` | `string` | ใช่ |
| `since` | `string (date-time)` | ใช่ |
| `until` | `string (date-time)` | ใช่ |

### Error ที่อาจได้

400 401 403 404 409 422

error ในรูป Problem Details ดูรหัสทั้งหมดที่ [รหัสข้อผิดพลาด](https://checkslip.com/docs/errors)

**cURL**

```bash
curl https://api.checkslip.com/api/webhooks/endpoints/string/recover \
  -H "Authorization: Bearer $CHECKSLIP_API_KEY" \
  -H "Idempotency-Key: order-1042-slip-1" \
  -H "Content-Type: application/json" \
  -d '{"since":"2026-11-05T09:30:00+07:00","until":"2026-11-05T09:30:00+07:00"}'
```

**Node.js**

```javascript
const res = await fetch("https://api.checkslip.com/api/webhooks/endpoints/string/recover", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.CHECKSLIP_API_KEY}`,
    "Idempotency-Key": "order-1042-slip-1",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    since: "2026-11-05T09:30:00+07:00",
    until: "2026-11-05T09:30:00+07:00",
  }),
});
const data = await res.json();
```

**Python**

```python
import os

import requests

res = requests.post(
    "https://api.checkslip.com/api/webhooks/endpoints/string/recover",
    headers={
        "Authorization": f"Bearer {os.environ['CHECKSLIP_API_KEY']}",
        "Idempotency-Key": "order-1042-slip-1",
    },
    json={
        "since": "2026-11-05T09:30:00+07:00",
        "until": "2026-11-05T09:30:00+07:00",
    },
)
data = res.json()
```

```json
{
  "endpoint_id": "string",
  "since": "2026-11-05T09:30:00+07:00",
  "until": "2026-11-05T09:30:00+07:00"
}
```
