Ocriva Logo

Documents

API Reference

เอกสารอ้างอิง REST API สำหรับแพลตฟอร์ม Ocriva

apireferencerest

Published: 3/31/2026

API Reference

Ocriva มี RESTful API สำหรับเชื่อมต่อการประมวลผลเอกสารเข้ากับแอปพลิเคชันของคุณ

Base URL

https://api.ocriva.com

Authentication

ทุก API request ต้องมีการยืนยันตัวตนผ่าน Bearer token (JWT) หรือ API Token

ใช้ JWT

curl -X POST https://api.ocriva.com/auth/login \
  -H "Content-Type: application/json" \
  -d '{"email": "user@example.com", "password": "your-password"}'

ใช้ API Token

curl https://api.ocriva.com/upload/YOUR_ORG_ID/file \
  -H "Authorization: Bearer YOUR_API_TOKEN"

ใช้ API Key (แนะนำสำหรับ Open API)

สำหรับการเชื่อมต่อจากระบบภายนอก สามารถใช้ API key ได้โดยตรง:

curl https://api.ocriva.com/v1/openapi/projects \
  -H "X-API-Key: ocr_your_api_key"

ดูรายละเอียดเพิ่มเติมที่ ภาพรวม Open API

IMPORTANT

ห้ามเปิดเผย API Token ใน client-side code หรือ public repository เด็ดขาด ใช้ server-side requests และเก็บ token ใน environment variables เท่านั้น

IMPORTANT

ห้ามเปิดเผย API Token ใน client-side code หรือ repository สาธารณะ ให้เก็บไว้ใน environment variables หรือ secrets manager เท่านั้น

Endpoints

อัปโหลดไฟล์

POST /upload/:organizationId/file

อัปโหลดแบบ Batch

POST /batch/:organizationId/upload

อัปโหลดหลายไฟล์พร้อมกัน (สูงสุด 50 ไฟล์)

WARNING

Batch upload รองรับสูงสุด 50 ไฟล์ต่อครั้ง timeout จะปรับอัตโนมัติตามจำนวนไฟล์

WARNING

Batch upload จำกัดสูงสุด 50 ไฟล์ต่อครั้ง หากมีเอกสารมากกว่านั้นให้แบ่งส่งหลายรอบ

ประวัติการประมวลผล

GET /processing-history?projectId=<id>&status=<status>&page=1&limit=20

Templates

GET /templates?projectId=<id>
POST /templates

Open API

สำหรับการเชื่อมต่อจากระบบภายนอก Ocriva มี Open API พร้อมการยืนยันตัวตนด้วย API key โดยตรง:

Error Handling

{
  "statusCode": 400,
  "message": "รายละเอียดข้อผิดพลาด",
  "error": "Bad Request"
}