API ของผู้พัฒนา
InteriorDecoratorAI API
ผสมผสานการออกแบบภายใน AI เข้ากับแอพพลิเคชันของคุณเอง สร้างการเปลี่ยนแปลงห้องโดยโปรแกรม
เริ่มต้น
เพื่อใช้ API คุณต้องมี API Token ดาวน์โหลดจากหน้าบัญชีของคุณ
การร้องขอ API ทั้งหมดต้องมีการตรวจสอบสิทธิ์ผ่านตัวบ่งชี้ Authorization Header
การตรวจสอบสิทธิ์
Authorization: Token YOUR_API_TOKEN
สร้างการแปลง
POST /api/conversion/
โหลดรูปภาพ และระบุประเภทห้อง และสไตล์ เพื่อสร้างการออกแบบ
ตัวอย่าง cURL
curl -X POST https://api.interiordecoratorai.com/interior/ \ -F "files=@room.jpg" \ -F "uuid=$(uuidgen)" \ -F "room_type=living_room" \ -F "style=modern" \ -F "space=interior"
ตัวอย่างภาษาไพธอน
import requests
import uuid
api_domain = "https://api.interiordecoratorai.com"
conversion_uuid = str(uuid.uuid4())
# Upload image for processing
with open("room.jpg", "rb") as f:
response = requests.post(
f"{api_domain}/interior/",
files={"files": f},
data={
"uuid": conversion_uuid,
"room_type": "living_room",
"style": "modern",
"space": "interior",
}
)
# Poll for results
result = requests.post(
f"{api_domain}/results/",
json={"conversion": conversion_uuid}
)
print(result.json())
ตรวจสอบผลลัพธ์
POST https://api.interiordecoratorai.com/results/
การตอบสนอง
{
"finished": true,
"files": [
{
"url": "/results/abc123.jpg",
"original": "/originals/abc123.jpg",
"thumbnail": "/thumbs/abc123.jpg"
}
]
}
พารามิเตอร์
| พารามิเตอร์ | ประเภท | จำเป็น | คำอธิบาย |
|---|---|---|---|
files | แฟ้ม | ใช่ | แฟ้มภาพ (JPG, PNG) |
uuid | ข้อความ | ใช่ | ตัวระบุเฉพาะสำหรับติดตาม |
room_type | ข้อความ | ใช่ | e.g., living_room, bedroom, kitchen |
style | ข้อความ | ใช่ | e.g., modern, scandinavian, industrial |
space | ข้อความ | ใช่ | "interior" or "exterior" |
renders | ตัวเลขสมบูรณ์ | ไม่มี | จำนวนของการเปลี่ยนแปลง (1-4, Pro เท่านั้น) |
upscale | บูเลียน | ไม่มี | ปรับขนาดให้เป็น 4K (เฉพาะโปรแกรม) |