# ส่งข้อความทดสอบ

Source: https://checkslip.com/docs/send-test-event

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

ใช้ API key

ส่งข้อความประเภท webhook.test ไปที่ endpoint นี้ พร้อมลายเซ็นและการส่งอีกรอบเหมือนข้อความจริง ใช้ลองว่าระบบของคุณรับข้อความและเทียบลายเซ็นได้ · ไม่ใช้เครดิต และไม่มีข้อมูลรายการโอน · คำตอบคือรายการส่งที่เข้าคิวแล้ว ดูผลต่อด้วย id ในคำตอบ · endpoint ที่ปิดอยู่ส่งไม่ได้ (ENDPOINT_DISABLED) · ต้องส่ง header Idempotency-Key · ใช้ API key ที่มีสิทธิ์ webhook:manage

## Parameters

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

## Responses

### 202 `application/json`

| ฟิลด์ | ชนิด | จำเป็น |
| --- | --- | --- |
| `id` | `string` | ใช่ |
| `message_id` | `string` | ใช่ |
| `endpoint_id` | `string` | ใช่ |
| `event_type` | `slip.checked \| webhook.test` | ใช่ |
| `request_id` | `string (uuid) \| null` | ใช่ |
| `status` | `PENDING \| RETRYING \| SUCCEEDED \| FAILED \| CANCELLED` | ใช่ |
| `attempt_count` | `integer` | ใช่ |
| `next_attempt_at` | `string (date-time) \| null` | ใช่ |
| `last_attempt_at` | `string (date-time) \| null` | ใช่ |
| `last_http_status` | `integer \| null` | ใช่ |
| `created_at` | `string (date-time)` | ใช่ |

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

400 401 403 404 409 422

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

**cURL**

```bash
curl -X POST https://api.checkslip.com/api/webhooks/endpoints/string/test \
  -H "Authorization: Bearer $CHECKSLIP_API_KEY" \
  -H "Idempotency-Key: order-1042-slip-1"
```

**Node.js**

```javascript
const res = await fetch("https://api.checkslip.com/api/webhooks/endpoints/string/test", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.CHECKSLIP_API_KEY}`,
    "Idempotency-Key": "order-1042-slip-1",
  },
});
const data = await res.json();
```

**Python**

```python
import os

import requests

res = requests.post(
    "https://api.checkslip.com/api/webhooks/endpoints/string/test",
    headers={
        "Authorization": f"Bearer {os.environ['CHECKSLIP_API_KEY']}",
        "Idempotency-Key": "order-1042-slip-1",
    },
)
data = res.json()
```

```json
{
  "id": "string",
  "message_id": "string",
  "endpoint_id": "string",
  "event_type": "slip.checked",
  "request_id": "0b6c2f5e-8a41-4d1e-9c3a-5f7e2d18a6b4",
  "status": "PENDING",
  "attempt_count": 1,
  "next_attempt_at": "2026-11-05T09:30:00+07:00",
  "last_attempt_at": "2026-11-05T09:30:00+07:00",
  "last_http_status": 1,
  "created_at": "2026-11-05T09:30:00+07:00"
}
```
