# ดูบันทึกคำขอ API

Source: https://checkslip.com/docs/list-api-requests

GET `https://api.checkslip.com/api/audit/requests`

ใช้ API key

แสดงคำขอที่บัญชีนี้ส่งเข้ามาทั้งผ่าน API key และเว็บแอป ใหม่สุดก่อน · แต่ละรายการมี request_id, route, http_status, outcome_code และ api_key_id ที่ใช้ · ส่ง trans_ref หรือ qr_sha256 เพื่อดูว่าเคยส่งสลิปใบนั้นมาแล้วหรือยัง · ค่าเริ่มต้นคือ 24 ชั่วโมงล่าสุด ดูได้ครั้งละไม่เกิน 31 วัน ใช้ next_cursor เพื่อดูหน้าถัดไป ไม่มียอดรวม · ไม่หักเครดิต · ใช้ API key ที่มีสิทธิ์ audit:read หรือเข้าสู่ระบบบนเว็บแอป · บันทึกไม่เก็บชื่อ เบอร์ อีเมล หรือเลขบัญชีแบบเต็ม · IP ของผู้เรียกเก็บเป็นช่วงเครือข่าย (/24 หรือ /48) กับค่าแฮชมีกุญแจของ IP เต็ม ใช้จับคู่คำขอจากเครื่องเดียวกันได้ · แต่ละรายการแสดงทั้งสองค่า (client_ip_prefix, client_ip_hmac) · ไม่เก็บ IP เต็ม

## Parameters

| ฟิลด์ | ส่งทาง | ชนิด | จำเป็น |
| --- | --- | --- | --- |
| `from` | query | `string (date-time)` | ไม่ |
| `to` | query | `string (date-time)` | ไม่ |
| `http_status` | query | `integer[]` | ไม่ |
| `outcome_code` | query | `string[]` | ไม่ |
| `route` | query | `string[]` | ไม่ |
| `channel` | query | `API \| DASHBOARD \| ASSISTANT \| STAFF \| SYSTEM[]` | ไม่ |
| `api_key_id` | query | `string` | ไม่ |
| `trans_ref` | query | `string` | ไม่ |
| `qr_sha256` | query | `string` | ไม่ |
| `cursor` | query | `string` | ไม่ |
| `limit` | query | `integer` | ไม่ |

## Responses

### 200 `application/json`

| ฟิลด์ | ชนิด | จำเป็น |
| --- | --- | --- |
| `items` | `ApiRequestRecord[]` | ใช่ |
| `items[].request_id` | `string (uuid)` | ใช่ |
| `items[].received_at` | `string (date-time)` | ใช่ |
| `items[].latency_ms` | `integer` | ใช่ |
| `items[].channel` | `API \| DASHBOARD \| ASSISTANT \| STAFF \| SYSTEM \| null` | ใช่ |
| `items[].method` | `GET \| POST \| PUT \| PATCH \| DELETE` | ใช่ |
| `items[].route` | `string` | ใช่ |
| `items[].http_status` | `integer` | ใช่ |
| `items[].api_key_id` | `string \| null` | ไม่ |
| `items[].user_id` | `string (uuid) \| null` | ไม่ |
| `items[].client_ip_prefix` | `string` | ไม่ |
| `items[].client_ip_hmac` | `string` | ไม่ |
| `items[].user_agent` | `string` | ไม่ |
| `items[].outcome_code` | `string` | ไม่ |
| `items[].fingerprint` | `Fingerprint \| null` | ไม่ |
| `next_cursor` | `string \| null` | ใช่ |

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

400 401 403 429

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

**cURL**

```bash
curl https://api.checkslip.com/api/audit/requests \
  -H "Authorization: Bearer $CHECKSLIP_API_KEY"
```

**Node.js**

```javascript
const res = await fetch("https://api.checkslip.com/api/audit/requests", {
  headers: {
    Authorization: `Bearer ${process.env.CHECKSLIP_API_KEY}`,
  },
});
const data = await res.json();
```

**Python**

```python
import os

import requests

res = requests.get(
    "https://api.checkslip.com/api/audit/requests",
    headers={
        "Authorization": f"Bearer {os.environ['CHECKSLIP_API_KEY']}",
    },
)
data = res.json()
```

```json
{
  "items": [
    {
      "request_id": "0b6c2f5e-8a41-4d1e-9c3a-5f7e2d18a6b4",
      "received_at": "2026-11-05T09:30:00+07:00",
      "latency_ms": 1,
      "channel": "API",
      "method": "GET",
      "route": "string",
      "http_status": 100,
      "api_key_id": "string",
      "user_id": "0b6c2f5e-8a41-4d1e-9c3a-5f7e2d18a6b4",
      "client_ip_prefix": "string",
      "client_ip_hmac": "string",
      "user_agent": "string",
      "outcome_code": "string",
      "fingerprint": {
        "qr_sha256": "string",
        "trans_ref": "string"
      }
    }
  ],
  "next_cursor": "string"
}
```
