ผู้ติดต่อ: กิจกรรม

แสดงรายการเหตุการณ์

ประวัติของผู้ติดต่อหนึ่งราย ใหม่สุดก่อน: การส่ง การเปิด การคลิก bounce การร้องเรียน และการยกเลิกรับ

POSThttps://g.sendcorex.com/v1/contactscommand: list_events

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

เหตุการณ์ถูกบันทึกโดยการส่งและการติดตาม API อ่านได้อย่างเดียว

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

  • emailstringจำเป็น

    ผู้ติดต่อ

    เช่น "ana@acme.com"

  • typesstring[]ไม่บังคับ

    เฉพาะประเภทเหล่านี้: sent, open, click, bounce, complaint, unsubscribe

    เช่น ["open", "click"]

  • limitnumberไม่บังคับ

    ขนาดหน้า 1 ถึง 1000 ค่าเริ่มต้น 50

  • cursorstringไม่บังคับ

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

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

import axios from 'axios';

const response = await axios.post(
  'https://g.sendcorex.com/v1/contacts',
  {
    commands: [
      {
        command: "list_events",
        args: {
          email: "ana@acme.com",
          types: [
            "open",
            "click"
          ],
          limit: 50
        }
      }
    ]
  },
  { 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_events",
      "id": "0",
      "type": "SUCCESS",
      "took_ms": 14,
      "data": {
        "events": [
          {
            "event_id": "ev_7c1d02",
            "type": "click",
            "at": "2026-10-14T21:04:10.000Z",
            "campaign_id": "cmp_october",
            "list_id": "customers",
            "url": "https://acme.com/offer",
            "ip": "203.0.113.24",
            "user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_0 like Mac OS X)",
            "reason": null,
            "by_proxy": false,
            "hard": null,
            "meta": null
          },
          {
            "event_id": "ev_7c1cf9",
            "type": "open",
            "at": "2026-10-14T21:03:55.000Z",
            "campaign_id": "cmp_october",
            "list_id": "customers",
            "url": null,
            "ip": "203.0.113.24",
            "user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_0 like Mac OS X)",
            "reason": null,
            "by_proxy": false,
            "hard": null,
            "meta": null
          }
        ],
        "has_more": true,
        "next_cursor": "eyJ0IjoxNzYwNDc1ODM1fQ"
      }
    }
  ]
}

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

  • events[].type

    sent, open, click, bounce, complaint หรือ unsubscribe

  • events[].at

    เกิดขึ้นเมื่อไร

  • events[].campaign_id / list_id

    แคมเปญและรายชื่อที่อีเมลนั้นอยู่ หากทราบ

  • events[].url

    ลิงก์ ในเหตุการณ์ click

  • events[].ip / user_agent

    การเปิดหรือคลิกมาจากที่ไหน

  • events[].by_proxy

    true เมื่อการเปิดมาจากพร็อกซีความเป็นส่วนตัวของเมล ไม่ใช่จากบุคคล

  • events[].reason / hard

    ใน bounce: เหตุผล และเป็น hard bounce หรือไม่

  • has_more / next_cursor

    การแบ่งหน้า ส่ง next_cursor เป็น cursor เพื่อดูเหตุการณ์ที่เก่ากว่า

ข้อผิดพลาด

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

  • 401INVALID_API_KEY

    API key ไม่มีอยู่ ถูกเพิกถอน หรือถูกปิดในแดชบอร์ด

  • 429RATE_LIMITED

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

  • CMDMISSING_SCOPE

    API key ไม่มีขอบเขตที่คำสั่งนี้ต้องการ คำสั่งอื่นในคำขอยังทำงาน

  • CMDINVALID_ARGS

    อาร์กิวเมนต์ที่จำเป็นหายไปหรือไม่ถูกต้อง: อีเมล ค่าฟิลด์ ตัวเลือก enum คีย์ where id รายชื่อ…

  • CMDINVALID_CURSOR

    cursor ผิดรูปแบบหรือเป็นของคิวรีหรือบัญชีอื่น

  • CMDINTERNAL

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