บันทึก: การอ่าน
List Scheduled
อีเมลที่คุณตั้งเวลาผ่าน Email API (`scheduledAt`) หรือแคมเปญที่ยังไม่ได้ส่ง อีเมลที่จะส่งถัดไปอยู่ก่อน
https://g.sendcorex.com/v1/logscommand: list_scheduledต้องมี scope logs:read ใน API key ของคุณ
เมื่ออีเมลถูกส่งจะแสดงใน List Logs เมื่อถูกยกเลิกจะหายจากรายการนี้ ข้อความที่ตั้งเวลาในเว็บเมลไม่อยู่ที่นี่ แต่อยู่ในโฟลเดอร์ Scheduled ของกล่องจดหมาย
เมื่อ scheduled_at ผ่านไปแล้ว อีเมลกำลังถูกส่งอยู่ในขณะนี้และจะย้ายไปที่ List Logs ภายในไม่กี่วินาที
อาร์กิวเมนต์
limitnumberไม่บังคับจำนวนอีเมลต่อหน้า 1 ถึง 50 ค่าเริ่มต้น 50
เช่น
50cursorstringไม่บังคับnext_cursorจากหน้าก่อนหน้า
เริ่มต้นอย่างรวดเร็ว
import axios from 'axios';
const response = await axios.post(
'https://g.sendcorex.com/v1/logs',
{
commands: [
{
command: "list_scheduled",
args: {
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_scheduled",
"id": "0",
"type": "SUCCESS",
"took_ms": 18,
"data": {
"scheduled": [
{
"id": "3f2a1b4c-8e9d-4f7a-b2c3-1a2b3c4d5e6f",
"from": "news@yourdomain.com",
"to": "ana@acme.com",
"subject": "Your order shipped",
"scheduled_at": "2026-12-01T09:00:00.000Z",
"source": "api",
"created_at": "2026-11-28T03:10:00.000Z"
},
{
"id": "9b7e2c1a-4d5f-4e6a-8b9c-0d1e2f3a4b5c",
"from": "hello@yourdomain.com",
"to": "bruno@acme.com",
"subject": "December news",
"scheduled_at": "2026-12-02T14:30:00.000Z",
"source": "campaign",
"campaign_id": "c_4f2a91",
"created_at": "2026-11-27T18:00:00.000Z"
}
],
"count": 2,
"has_more": true,
"next_cursor": "MDAwMDAwMDA4MzowOjgyMzkzMTU5OTg3OTU6M2YyYTFi"
}
}
]
}ฟิลด์การตอบกลับ
scheduledอีเมลที่ตั้งเวลาของหน้านี้ รายการที่จะส่งถัดไปก่อน
countจำนวนอีเมลในหน้านี้
has_more / next_cursorขณะที่
has_moreเป็นtrueให้ส่งnext_cursorเป็นcursorเพื่อรับหน้าถัดไป ไม่มีจำนวนรวมscheduled[].idID อีเมล คือ
idเดียวกับที่คุณได้รับตอนส่งscheduled[].from / scheduled[].toที่อยู่ผู้ส่งและผู้รับ
scheduled[].subjectหัวเรื่องของอีเมล
scheduled[].scheduled_atเวลาที่อีเมลจะถูกส่ง (ISO 8601, UTC)
scheduled[].source / scheduled[].campaign_idapiสำหรับ Email API,campaignสำหรับแคมเปญ เมื่อเป็นcampaignจะมีค่าcampaign_idscheduled[].created_atเวลาที่ตั้งเวลาอีเมล (ISO 8601, UTC)
การอ่านทุกหน้า
เรียกต่อด้วย next_cursor จนกว่า has_more เป็น false
Node.js
const scheduled = [];
let cursor;
do {
const [result] = await call({
command: 'list_scheduled',
args: { limit: 50, ...(cursor ? { cursor } : {}) },
});
scheduled.push(...result.data.scheduled);
cursor = result.data.has_more ? result.data.next_cursor : null;
} while (cursor);ข้อผิดพลาด
ข้อผิดพลาดระดับ HTTP ส่งกลับ type, code และ message ข้อผิดพลาดที่มีเครื่องหมาย CMD จะกลับมาในผลลัพธ์ของคำสั่ง พร้อม HTTP 200
- 401
INVALID_API_KEYAPI key ไม่มีอยู่ ถูกเพิกถอน หรือถูกปิดในแดชบอร์ด
- 429
RATE_LIMITEDเกิน 15 คำขอ/วินาที หรือ 15 คำขอพร้อมกันสำหรับ IP + API key เดียวกัน รอจำนวนวินาทีใน Retry-After
- CMD
MISSING_SCOPEAPI key ไม่มี `logs:read`
- CMD
INVALID_ARGSอาร์กิวเมนต์ไม่ถูกต้อง: สถานะที่ไม่รู้จัก ผู้รับที่ไม่ใช่อีเมลเต็ม limit อยู่นอกช่วง id ที่ไม่ใช่ UUID after อยู่หลัง before…
- CMD
INVALID_CURSORcursor รูปแบบไม่ถูกต้อง หรือมาจากการค้นหาหรือบัญชีอื่น ให้เริ่มใหม่โดยไม่มี cursor
- CMD
INTERNALข้อผิดพลาดของเซิร์ฟเวอร์ รายละเอียดเขียนเฉพาะในล็อกเซิร์ฟเวอร์