---
agent:
  instructions: "Use this search API to find relevant content across this site with keywords or natural-language queries, instead of crawling individual pages. Results are returned in Markdown."
  endpoint: "https://docs.sendcorex.com/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://docs.sendcorex.com/llms.txt"
---

Source: https://docs.sendcorex.com/th/api-reference/contacts/lists/list-members

ผู้ติดต่อ: รายชื่อ

# แสดงรายการสมาชิก

ไล่สมาชิกของรายชื่อตามลำดับอีเมล เลือกเฉพาะที่ส่งได้ก็ได้ วิธีที่เร็วที่สุดในการส่งออกหรือส่งถึงทั้งรายชื่อ

POST `https://g.sendcorex.com/v1/contacts` command: list_members

ต้องมีขอบเขต `contact:read` บน API key ของคุณ

## อาร์กิวเมนต์

- `list_id` string จำเป็น
รายชื่อ
เช่น `"customers"`
- `sendable_only` boolean ไม่บังคับ
เฉพาะสมาชิกที่สมัครรับรายชื่อและมีสถานะ `subscribed` กรองที่เซิร์ฟเวอร์
- `hydrate` boolean ไม่บังคับ
เพิ่มข้อมูลผู้ติดต่อทั้งหมดให้แต่ละสมาชิก ลด `limit` สูงสุดเหลือ 1000
- `limit` number ไม่บังคับ
ขนาดหน้า 1 ถึง 5000 (1000 เมื่อใช้ `hydrate`) ค่าเริ่มต้น 100
- `cursor` string ไม่บังคับ
`next_cursor` ของหน้าก่อน
- `select` string[] ไม่บังคับ
เมื่อใช้ `hydrate` ส่งกลับเฉพาะส่วนเหล่านี้ของผู้ติดต่อแต่ละราย เช่น `["first_name", "fields.plan"]` `email` จะกลับมาเสมอ

## เริ่มต้นอย่างรวดเร็ว

```
import axios from 'axios';

const response = await axios.post(
  'https://g.sendcorex.com/v1/contacts',
  {
    commands: [
      {
        command: "list_members",
        args: {
          list_id: "customers",
          sendable_only: true,
          limit: 1000
        }
      }
    ]
  },
  { headers: { Authorization: process.env.SENDCOREX_API_KEY } },
);

const [result] = response.data.results;
if (result.type !== 'SUCCESS') throw new Error(`${result.code}: ${result.message}`);
console.log(result.data);
```

## การตอบกลับ

```
{
  "type": "SUCCESS",
  "results": [
    {
      "command": "list_members",
      "id": "0",
      "type": "SUCCESS",
      "took_ms": 14,
      "data": {
        "members": [
          {
            "email": "ana@acme.com",
            "sendable": true,
            "subscribed": true,
            "added_at": "2026-10-13T06:05:08.323Z"
          },
          {
            "email": "bob@gmail.com",
            "sendable": true,
            "subscribed": true,
            "added_at": "2026-10-13T06:05:08.323Z"
          }
        ],
        "has_more": true,
        "next_cursor": "eyJsIjoiY3VzdG9tZXJzIn0"
      }
    }
  ]
}
```

### ฟิลด์การตอบกลับ

- `members[].email`
อีเมลของสมาชิก
- `members[].subscribed`
สมัครรับรายชื่อนี้
- `members[].sendable`
สมัครรับรายชื่อนี้และมีสถานะ `subscribed`
- `members[].added_at`
เวลาที่ผู้ติดต่อเข้าร่วมรายชื่อ
- `members[].contact`
ผู้ติดต่อ เฉพาะเมื่อใช้ `hydrate`
- `has_more / next_cursor`
การแบ่งหน้า ส่ง `next_cursor` เป็น `cursor` เพื่อดูหน้าถัดไป

## พร้อมข้อมูลผู้ติดต่อทั้งหมด

เมื่อใช้ `hydrate: true` สมาชิกแต่ละรายจะมี `contact` มาด้วย เพิ่ม `select` เพื่อให้ payload เล็ก เช่น เฉพาะชื่อและฟิลด์ที่ใช้ในอีเมล

สมาชิกหนึ่งรายแบบ hydrate

```
{
  "email": "ana@acme.com",
  "sendable": true,
  "subscribed": true,
  "added_at": "2026-10-13T06:05:08.323Z",
  "contact": {
    "email": "ana@acme.com",
    "first_name": "Ana",
    "fields": {
      "plan": "pro"
    }
  }
}
```

## List Members หรือ Query Contacts?

List Members อ่านรายชื่อเดียวตามลำดับอีเมลได้เร็วที่สุด เมื่อต้องกรองตามแท็ก ฟิลด์ หรือการมีส่วนร่วมด้วย ให้ใช้ Query Contacts กับ `list` ใน `where`

## ข้อผิดพลาด

ข้อผิดพลาดระดับ HTTP ส่งกลับ `type`, `code` และ `message` ข้อผิดพลาดที่มีเครื่องหมาย CMD จะกลับมาในผลลัพธ์ของคำสั่ง พร้อม HTTP 200

- 401`INVALID_API_KEY`
API key ไม่มีอยู่ ถูกเพิกถอน หรือถูกปิดในแดชบอร์ด
- 429`RATE_LIMITED`
เกิน 15 คำขอ/วินาที หรือ 15 คำขอพร้อมกันสำหรับ IP + API key เดียวกัน รอจำนวนวินาทีใน Retry-After
- CMD`MISSING_SCOPE`
API key ไม่มีขอบเขตที่คำสั่งนี้ต้องการ คำสั่งอื่นในคำขอยังทำงาน
- CMD`INVALID_ARGS`
อาร์กิวเมนต์ที่จำเป็นหายไปหรือไม่ถูกต้อง: อีเมล ค่าฟิลด์ ตัวเลือก enum คีย์ where id รายชื่อ…
- CMD`NOT_FOUND`
ไม่มีผู้ติดต่อ รายชื่อ ฟิลด์ หรือกลุ่มนี้
- CMD`INVALID_CURSOR`
cursor ผิดรูปแบบหรือเป็นของคิวรีหรือบัญชีอื่น
- CMD`INTERNAL`
ข้อผิดพลาดของเซิร์ฟเวอร์ รายละเอียดเขียนเฉพาะในล็อกเซิร์ฟเวอร์
