Project

General

Profile

Actions

DOPA » History » Revision 1

Revision 1/3 | Next »
prin methirattanasophon, 02/20/2026 05:54 AM


DOPA

Objective: API for verify user's citizen ID card status with DOPA service

Mock logic:

check mock: first_name == mockFirstName && last_name == mockLastName
check status: national_id == mockPID && date_of_birth == mockDOB && laser_code == mockLaser

API:

Paylod:

key type value
national_id string ID card number
first_name string firstname
last_name string lastname
date_of_birth string yyyyMMdd
laser_code string laser code

Return:

key type value
success bool
message string "success", "failed", "Invalid request body"
data Object DOPA Object | Internal Error Object

DOPA Object

key type value mandatory
code string Y
desc string card status message Y
isNormal bool card stauts, true= normal, false= abnormal Y
recomendation string recommend message Y

Internal Error Object

key type value mandatory
code string Y
message string invalid message by internal check Y

Exmaple Request and Response:

Expected Mock Payload:

{
  "national_id": "6400719122941",
  "first_name": "ทดสอบ",
  "last_name": "บัตร",
  "date_of_birth": "25430101",
  "laser_code": "AB0123456789"
}

Expected Return when Card Status is Normal:

{
    "success": true,
    "message": "success",
    "data": {
        "code": 0,
        "desc": "สถานะปกติ",
        "isNormal": true,
        "recommendation": "normal"
    }
}

Expected Return when Card Status is Abnormal:

{
    "success": true,
    "message": "failed",
    "data": {
        "code": 2,
        "desc": "บัตรสถานะไม่ปกติ",
        "isNormal": false,
        "recommendation": "contact_registry"
    }
}

Expected Return when national_id format is invalid by internal check:

{
    "success": false,
    "message": "Invalid request body",
    "error": {
        "code": "23100",
        "message": "field is invalid: PID with request_id: f408c4e2-4296-4f84-b05d-d7fe51961b01"
    }
}

Updated by prin methirattanasophon about 2 months ago · 3 revisions