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

Check Recipients

บอกว่าผู้รับคนไหนยกเลิกรับจากกล่องจดหมายนี้ อ่านอย่างเดียว

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

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

  • emailsstring[]จำเป็น

    1 ถึง 100 ที่อยู่

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

import axios from 'axios';

const response = await axios.post(
  'https://g.sendcorex.com/v1',
  {
    commands: [
      {
        command: "check_recipients",
        args: {
          emails: [
            "ana@empresa.com",
            "joao@empresa.com"
          ]
        }
      }
    ]
  },
  { 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": "check_recipients",
      "id": "0",
      "type": "SUCCESS",
      "data": {
        "recipients": [
          {
            "email": "ana@empresa.com",
            "subscribed": true,
            "unsubscribed_at": null
          },
          {
            "email": "joao@empresa.com",
            "subscribed": false,
            "unsubscribed_at": "2026-11-02T14:10:00Z"
          }
        ]
      }
    }
  ]
}

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

  • recipients[]

    email, subscribed และ unsubscribed_at

ข้อผิดพลาด

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

  • 401TOKEN_EXPIRED

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

  • 401INVALID_TOKEN

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

  • 429RATE_LIMITED

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

  • CMDINVALID_ARGS

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

  • CMDINTERNAL

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