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

Get Delivery Status

การส่งถึงของอีเมลที่ส่งหนึ่งฉบับ แยกตามผู้รับ อ่านอย่างเดียว

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

status: delivered, sending, retrying, rate_limited, bounced, spam, not_sent, filtered หรือ suppressed

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

  • idstringจำเป็น

    message_uid ของอีเมลที่ส่ง

  • cursornumberไม่บังคับ

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

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

import axios from 'axios';

const response = await axios.post(
  'https://g.sendcorex.com/v1',
  {
    commands: [
      {
        command: "get_delivery_status",
        args: {
          id: "Vj0xQUJDMTIz"
        }
      }
    ]
  },
  { 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": "get_delivery_status",
      "id": "0",
      "type": "SUCCESS",
      "data": {
        "total": 2,
        "audience_total": null,
        "recipients": [
          {
            "email": "ana@empresa.com",
            "status": "delivered",
            "reason": null,
            "at": "2026-11-21T09:40:00Z"
          },
          {
            "email": "joao@empresa.com",
            "status": "bounced",
            "reason": "550 mailbox not found",
            "at": "2026-11-21T09:40:02Z"
          }
        ],
        "cursor": null
      }
    }
  ]
}

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

  • total

    ผู้รับที่มีสถานะแล้วจนถึงตอนนี้

  • audience_total

    การส่งในเวลาที่ดีที่สุด: จำนวนคนที่ได้รับระหว่างวัน null สำหรับการส่งปกติ

  • recipients[]

    email, status, reason และ at 50 ต่อหน้า

  • cursor

    หน้าถัดไป หรือ null

ข้อผิดพลาด

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

  • 401TOKEN_EXPIRED

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

  • 401INVALID_TOKEN

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

  • 429RATE_LIMITED

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

  • CMDINVALID_ARGS

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

  • CMDNOT_FOUND

    ไม่มีข้อความ เธรด หรือโฟลเดอร์นี้สำหรับโทเค็นนี้

  • CMDINTERNAL

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