API Reference · Key Extraction v3

Schemas

ตรวจและ normalize JSON Schema ก่อนสร้างงาน ไม่เรียก OCR และไม่คิดเครดิต schema ที่ใช้ดึงข้อมูลเป็น subset เข้ม ไม่ใช่ JSON Schema เต็มรูป

Validate schema

POSThttps://backend.aksonocr.com/api/v3/key-extract/schemas/validate
ฟิลด์ชนิดจำเป็นรายละเอียด
data_schemaobjectใช่รากต้องเป็น type: object + properties
json
{
"data_schema": {
"type": "object",
"properties": {
"invoice_no": { "type": "string", "description": "เลขที่ใบแจ้งหนี้" }
}
}
}

Response 200

json
{
"valid": true,
"normalized_schema": {
"type": "object",
"additionalProperties": false,
"properties": {
"invoice_no": { "type": ["string", "null"] }
}
},
"stats": { "leaf_fields": 1, "arrays": 0, "max_depth": 1 },
"warnings": [],
"request_id": "req_01J..."
}

สเกลาร์ถูกทำให้ nullable ภายใน เซิร์ฟเวอร์ไม่ใส่ค่า default เมื่อแหล่งไม่มีข้อมูล

สิ่งที่รองรับ

ฟีเจอร์รองรับ
รากtype: object เท่านั้น
สเกลาร์string, number, integer, boolean
object ซ้อนได้ ความลึกสูงสุด 5
ตารางarray ของ object หรือสเกลาร์ สูงสุด 10 ตาราง, 50 คอลัมน์, 2,000 แถว
คำใบ้description, examples, enum (≤ 100), format, required
format ของ stringdate, date-time, time, email, uri
ขนาด schema≤ 128 KiB, leaf ≤ 200
ไม่รองรับ: $ref, oneOf / anyOf / allOf, recursion, nested arrays คำตอบ 422 จะชี้ pointer ไปยัง construct ที่ไม่ผ่าน

Errors

HTTPcode
422invalid_schema
json
{
"type": "https://docs.aksonocr.com/problems/invalid-schema",
"title": "Schema is invalid",
"status": 422,
"code": "invalid_schema",
"detail": "The schema contains unsupported constructs.",
"retryable": false,
"errors": [
{
"pointer": "/data_schema/properties/items/items",
"code": "nested_array_not_supported",
"detail": "Nested arrays are not supported."
}
],
"request_id": "req_01J..."
}