รับอีเมล: ผู้ติดต่อและกลุ่มเป้าหมาย

List Contacts

แสดงคนที่ติดต่อกับกล่องจดหมายนี้ ด้วยตัวกรองเดียวกับแดชบอร์ด อ่านอย่างเดียว

POSThttps://g.sendcorex.com/v1command: list_contacts

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

  • whereobjectไม่บังคับ

    ตัวกรอง: สถานะ แท็ก โดเมน การเปิดและคลิก วันที่ และฟิลด์กำหนดเอง รูปแบบเดียวกับผู้ติดต่อในแดชบอร์ด

  • sortobjectไม่บังคับ

    { field }: email, created_at, last_open_at, last_click_at, open_count หรือ click_count

  • limitnumberไม่บังคับ

    ขนาดหน้า 1 ถึง 100

  • cursorstringไม่บังคับ

    next_cursor ของหน้าก่อน

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

import axios from 'axios';

const response = await axios.post(
  'https://g.sendcorex.com/v1',
  {
    commands: [
      {
        command: "list_contacts",
        args: {
          where: {
            last_open_at: {
              within_days: 30
            }
          },
          limit: 50
        }
      }
    ]
  },
  { headers: { Authorization: process.env.SENDCOREX_TOKEN } },
);

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_contacts",
      "id": "0",
      "type": "SUCCESS",
      "data": {
        "contacts": [
          {
            "email": "ana@empresa.com",
            "first_name": "Ana",
            "last_name": "Lima",
            "status": "subscribed",
            "tags": [
              "hot"
            ],
            "counts": {
              "sent": 4,
              "opens": 3,
              "clicks": 1
            },
            "dates": {
              "last_open_at": "2026-11-21T09:42:00Z",
              "last_click_at": "2026-11-21T09:43:00Z"
            },
            "trust": "default",
            "company": "Empresa",
            "lists": [],
            "fields": {}
          }
        ],
        "has_more": false,
        "next_cursor": null
      }
    }
  ]
}

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

  • contacts[]

    อีเมล ชื่อ บริษัท สถานะ แท็ก รายชื่อ ฟิลด์ จำนวน วันที่ และความน่าเชื่อถือในกล่องจดหมายนี้

  • has_more / next_cursor

    การแบ่งหน้า

ข้อผิดพลาด

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

  • 401TOKEN_EXPIRED

    access token หมดอายุแล้ว เรียก Refresh Token แล้วส่งคำขอซ้ำ

  • 401INVALID_TOKEN

    โทเค็นผิดรูปแบบ ไม่รู้จัก หรือถูกเพิกถอน

  • 429RATE_LIMITED

    เกิน 15 คำขอ/วินาที หรือ 15 คำขอพร้อมกันสำหรับ IP + กล่องจดหมายเดียวกัน รอจำนวนวินาทีใน Retry-After

  • CMDINVALID_ARGS

    อาร์กิวเมนต์ที่จำเป็นหายไปหรือไม่ถูกต้อง

  • CMDINVALID_CURSOR

    cursor ผิดรูปแบบหรือเป็นของบัญชีหรือโฟลเดอร์อื่น

  • CMDINTERNAL

    ข้อผิดพลาดของเซิร์ฟเวอร์ รายละเอียดเขียนเฉพาะในล็อกเซิร์ฟเวอร์