ข้ามไปยังเนื้อหาหลัก

แนวคิดหลัก

คำศัพท์สำคัญ

TermDescriptionExample
template_codeรหัสอ้างอิงของ consent templatedemo_mobile_kyc
customer_idรหัสผู้ใช้หรือลูกค้า550e8400-e29b-41d4-a716-446655440000
consent_version_idรหัสเฉพาะของแต่ละ template version123e4567-e89b-12d3-a456-426614174010

Published กับ Pending

TypeEndpointWhen to use
Published/v1/consent-templates/{code}/latestใช้ดึง template ปัจจุบันที่พร้อมแสดงให้ผู้ใช้ทุกคน
Pending/v1/customers/{id}/consents/templates/{code}/pendingใช้ตรวจสอบว่าผู้ใช้มี template update ที่ยังไม่ยอมรับหรือไม่

ตัวอย่าง Pending: มีการปล่อย Template v2.0 แล้ว แต่ผู้ใช้ยังไม่เคยเห็น → accepted: false หลังจากผู้ใช้ตัดสินใจแล้ว → accepted: true

ค่า Decision

ValueMeaning
givenผู้ใช้ยินยอม
rejectผู้ใช้ปฏิเสธ
withdrawผู้ใช้ถอนความยินยอมที่เคยให้ไว้

การทำงานโดยสรุป

1. GET /latest → แสดง consent template ปัจจุบันให้ผู้ใช้
2. GET /pending → ตรวจสอบว่าผู้ใช้มีรายการอัปเดตที่ต้องตัดสินใจหรือไม่
3. POST /decisions → บันทึกคำตอบของผู้ใช้ (given/reject/withdraw)