Skip to Content
🚀 Welcome to Humansoft Open API Documentation

Submit Complaint

ยื่นคำขอสร้างเอกสารร้องเรียนพนักงานใหม่เข้าสู่ระบบ โดยเอกสารที่สร้างขึ้นใหม่จะเริ่มต้นด้วยสถานะรอพิจารณา (Waiting for consideration)

ระบบจะค้นหาข้อมูลพนักงานผู้ร้องเรียนจาก informer_employee_code เป็นลำดับแรก หากไม่พบจะค้นหาจาก informer_employee_id

Endpoint

POST /api/v1/open-apis/complaint/submit

สิทธิ์ที่ต้องการ: API Key ต้องมีสิทธิ์ ข้อมูลการยื่นเอกสาร (document:manage)

Request Parameters

Required Parameters

ParameterTypeRequiredDescriptionExample
complaint_dtstringYesวันที่ร้องเรียน (YYYY-MM-DD)2026-03-30
complaint_type_lvstringYesรหัสประเภทการร้องเรียน01
complaint_descstringYesรายละเอียดการชี้แจง / เหตุการณ์ที่ร้องเรียนพบเห็นการทุจริตในเวลางาน
informer_employee_codestringYes*รหัสพนักงานผู้ร้องเรียน (*บังคับอย่างใดอย่างหนึ่งระหว่าง _code หรือ _id)EMP001
informer_employee_idstring (base64)Yes*ID ของผู้ร้องเรียน (Base64 encoded) (*บังคับอย่างใดอย่างหนึ่งระหว่าง _code หรือ _id)MjAyNTExMjdENDU3M0M0MjE2Mzk=

Optional Parameters

ParameterTypeRequiredDescriptionExample
complaint_visible_lvstringNoระดับการแสดงตัวตนของผู้ร้องเรียน (N = ไม่เปิดเผยข้อมูล)N
complaint_attachmentstringNoรูปภาพหลักฐานแนบแบบ Base64 — ส่งเป็น Base64 ล้วน หรือเป็น Data URI ที่ขึ้นต้นด้วย data:image/ ก็ได้iVBORw0KGgoAAAANSUhEUg...

Complaint Type Values (complaint_type_lv)

ValueENTH
01Corruptionทุจริต
02Breaking the rulesไม่ปฏิบัติตามกฎระเบียบ
03Bullied, Intimidatedถูกกลั่นแกล้ง ข่มขู่
04Work failedปฏิบัติงานผิดพลาด
05Working behaviorพฤติกรรมการทำงาน
06Othersอื่นๆ

Request Body Example

{ "complaint_dt": "2026-03-30", "complaint_type_lv": "01", "complaint_desc": "พบเห็นการทุจริตการเบิกจ่ายงบประมาณ", "informer_employee_code": "EMP001", "complaint_visible_lv": "N" }

Response Format

Success Response (HTTP 200)

{ "code": 200, "message": "ร้องเรียนสำเร็จ", "payload": { "complaint_id": "20251127D4573C421639", "complaint_dt": "2026-03-30", "complaint_type_lv": "01", "complaint_desc": "พบเห็นการทุจริตการเบิกจ่ายงบประมาณ", "complaint_employee_id": "", "informer_employee_id": "20251127D4573C421639", "complaint_status_lv": "01", "complaint_visible_lv": "N", "complaint_attachment": null, "message": "ร้องเรียนสำเร็จ" } }

ตัวอย่าง complaint_attachment เมื่อแนบรูปภาพมาด้วย:

"complaint_attachment": "https://cdn.humansoft.co.th/.../image/a1B2c3D4e5.png"

Response Fields

FieldTypeDescription
complaint_idstringรหัสเอกสารร้องเรียนที่สร้าง
complaint_dtstringวันที่ร้องเรียน
complaint_type_lvstringรหัสประเภทการร้องเรียน
complaint_descstringรายละเอียดการร้องเรียน
complaint_employee_idstringID ของพนักงานที่ถูกร้องเรียน
informer_employee_idstringID ของผู้ร้องเรียน
complaint_status_lvstringสถานะเอกสาร (เริ่มต้นที่ 01 - รอพิจารณา)
complaint_visible_lvstringระดับการแสดงตัวตน
complaint_attachmentstring | nullURL ของรูปภาพหลักฐานแนบ (null หากไม่ได้แนบรูปภาพ)
messagestringข้อความผลการทำรายการ (เหมือนกับ message ระดับบนสุด)

Error Response - Validation Failed (HTTP 422)

{ "code": 422, "message": "การตรวจสอบข้อมูลล้มเหลว", "errors": [ "'complaint_dt' is required" ] }

Error Response - Employee Not Found (HTTP 400)

{ "code": 400, "message": "กระบวนการล้มเหลว", "error": "ไม่พบข้อมูลพนักงาน" }

ข้อความใน message และ error เป็นภาษาไทยโดยค่าเริ่มต้น หากส่ง language_code=EN จะได้ข้อความภาษาอังกฤษ (เช่น Validation failed, Process failed, Employee not found) ส่วนรายการใน errors เป็นภาษาอังกฤษเสมอ

Code Examples

curl -X POST "https://openapi.humansoft.co.th/api/v1/open-apis/complaint/submit" \ -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "complaint_dt": "2026-03-30", "complaint_type_lv": "01", "complaint_desc": "พบเห็นการทุจริตการเบิกจ่ายงบประมาณ", "informer_employee_code": "EMP001", "complaint_visible_lv": "N" }'

Notes

ข้อควรทราบ:

  • หากกำหนด complaint_visible_lv เป็น N ชื่อผู้ร้องเรียนในฟีดของ HR จะแสดงเป็น “ไม่เปิดเผยข้อมูล” (Anonymous)
  • รูปภาพที่ส่งมาเป็น Base64 ไม่ควรมีขนาดใหญ่มากเกินไป เพราะจะกระทบกับประสิทธิภาพ
  • ต้องระบุ informer_employee_code หรือ informer_employee_id อย่างน้อยหนึ่งค่า
  • พารามิเตอร์ที่ลงท้ายด้วย _id ต้องส่งเป็น Base64 encoded
  • Get List - ดูประวัติและรายการร้องเรียนพนักงานทั้งหมด
  • Get Detail - ดูรายละเอียดเรื่องร้องเรียนเฉพาะรายการ
Last updated on