وثائق إعادة التصميم الداخلي API#
الـ URL الأساسي:
https://api.ideal.house
الإصدار: v1
تم التحديث: 2026-05-21
📖 نظرة عامة#
يقوم إعادة التصميم الداخلي API بإعادة تصميم صورة داخلية ويمكنه اختيارياً استخدام خيارات نمط الغرفة، والتوجيه النصي، والتوجيه اللوني.
سير العمل غير متزامن:
- إنشاء مهمة — أرسل
imageUrlوالمعلمات الاختيارية، ثم احصل علىtaskId. - الاستعلام الدوري للحصول على النتائج — استخدم
taskIdلاسترداد حالة المهمة والصورة المُولدة.
🔐 المصادقة#
| الرأس | القيمة |
|---|---|
APIKEY | your_api_key_here |
💰 خصم الرصيد#
[!WARNING] يتم خصم 1 رصيد عند إنشاء المهمة بنجاح. إذا كانت المهمة في النهاية فاشلة، فسيتم إعادة رصيد المخصوم تلقائيًا.
سيؤدي نقص الرصيد إلى إرجاع رمز الخطأ9051. انظر مرجع خصم الرصيد.
| العملية | الرصيد المخصوم |
|---|---|
| مهمة إعادة التصميم الداخلي | 1 رصيد |
🎨 خيارات النمط#
تدعم هذه API معلمات أنماط اختيارية تُرجعها نقطة نهاية إعداد أنماط API.
استخدم:
GET /api/v1/style/interoir_remodel/getStyles
| مجموعة النمط | حقل الطلب | الوصف |
|---|---|---|
roomType | indoorTypeId | خيار نوع الغرفة |
style | indoorStyleId | خيار النمط الداخلي |
elements | indoorElemId | خيار عنصر الغرفة. يدعم عدة معرفات خيارات مفصولة بفاصلة، على سبيل المثال id1,id2 |
يحتوي كل خيار على name، id، و url. مرر خيار id إلى حقل الطلب المقابل.
🎨 التوجيه اللوني#
يعتبر colorString و colorImgUrl مدخلات اختيارية للتوجيه اللوني:
| الحالة | السلوك |
|---|---|
تم توفير colorString فقط | استخدم colorString |
تم توفير colorImgUrl فقط | استخدم صورة مرجع اللون |
| تم توفير كليهما | colorString له الأولوية |
| لم يتم توفير أي منهما | التوجيه اللوني الافتراضي هو auto |
📌 API نقاط النهاية#
1. إنشاء مهمة إعادة التصميم الداخلي#
نقطة النهاية
POST /api/v1/interiorRemodel/generate
رؤوس الطلب
| الرأس | مطلوب | الوصف |
|---|---|---|
APIKEY | ✅ نعم | مفتاح مصادقة API الخاص بك |
Content-Type | ✅ نعم | application/json |
جسم الطلب
| الحقل | النوع | مطلوب | الوصف |
|---|---|---|---|
imageUrl | string | ✅ نعم | URL للصورة الداخلية المصدر |
prompt | string | ❌ اختياري | توجيه نصي لإعادة التصميم المطلوبة |
indoorTypeId | string | ❌ اختياري | معرف نوع الغرفة من خيارات roomType |
indoorStyleId | string | ❌ اختياري | معرف النمط الداخلي من خيارات style |
indoorElemId | string | ❌ اختياري | معرف عنصر الغرفة من خيارات elements. يدعم عدة معرفات مفصولة بفاصلة، على سبيل المثال id1,id2 |
colorString | string | ❌ اختياري | سلسلة لوحة الألوان، على سبيل المثال [[174,238,238],[36,36,36]] |
colorImgUrl | string | ❌ اختياري | صورة مرجع اللون URL |
فقط
imageUrlمطلوب. جميع الحقول الأخرى اختيارية.
🖼️ متطلبات الصور: يجب أن تستخدم جميع الصور المصدر والمرجعية JPG/JPEG أو PNG أو WebP. يجب أن لا يتجاوز كل صورة 20 MB، بأبعاد تتراوح من 128 × 128 بكسل إلى 6,000 × 6,000 بكسل (شاملة). يتم تحويل أحجام الصور التي تتجاوز الحد الأقصى لأبعاد البكسل تلقائياً لتتناسب داخل 6,000 × 6,000 بكسل قبل المعالجة. يجب أن تكون جميع URLs الصور قابلة للوصول مباشرة بواسطة خادم API.
📥 أمثلة الطلب#
cURL
curl -X POST "https://api.ideal.house/api/v1/interiorRemodel/generate" \
-H "APIKEY: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"imageUrl": "https://example.com/interior.jpg",
"prompt": "modern warm remodel with clean built-in storage",
"indoorTypeId": "Interior Design_Interior Scene_Living Room",
"indoorStyleId": "Interior_Interior Style_Popular_Modern Country",
"indoorElemId": "Interior Design_Scene Elements_Living Room_Shelving,Interior Design_Scene Elements_Living Room_Coffee Table",
"colorString": "[[174,238,238],[36,36,36],[117,64,95]]"
}'
Java (OkHttp)
import okhttp3.*;
import java.io.IOException;
public class InteriorRemodelApiExample {
private static final String BASE_URL = "https://api.ideal.house";
private static final String API_KEY = "your_api_key_here";
public static void main(String[] args) throws IOException {
OkHttpClient client = new OkHttpClient();
String requestBody = """
{
"imageUrl": "https://example.com/interior.jpg",
"prompt": "modern warm remodel with clean built-in storage",
"indoorTypeId": "Interior Design_Interior Scene_Living Room",
"indoorStyleId": "Interior_Interior Style_Popular_Modern Country",
"indoorElemId": "Interior Design_Scene Elements_Living Room_Shelving,Interior Design_Scene Elements_Living Room_Coffee Table",
"colorString": "[[174,238,238],[36,36,36],[117,64,95]]"
}
""";
Request request = new Request.Builder()
.url(BASE_URL + "/api/v1/interiorRemodel/generate")
.addHeader("APIKEY", API_KEY)
.addHeader("Content-Type", "application/json")
.post(RequestBody.create(requestBody, MediaType.parse("application/json")))
.build();
try (Response response = client.newCall(request).execute()) {
System.out.println("Response: " + response.body().string());
}
}
}
Python (requests)
import requests
BASE_URL = "https://api.ideal.house"
API_KEY = "your_api_key_here"
headers = {
"APIKEY": API_KEY,
"Content-Type": "application/json"
}
payload = {
"imageUrl": "https://example.com/interior.jpg",
"prompt": "modern warm remodel with clean built-in storage",
"indoorTypeId": "Interior Design_Interior Scene_Living Room",
"indoorStyleId": "Interior_Interior Style_Popular_Modern Country",
"indoorElemId": "Interior Design_Scene Elements_Living Room_Shelving,Interior Design_Scene Elements_Living Room_Coffee Table",
"colorString": "[[174,238,238],[36,36,36],[117,64,95]]"
}
response = requests.post(
f"{BASE_URL}/api/v1/interiorRemodel/generate",
headers=headers,
json=payload
)
data = response.json()
task_id = data.get("data")
print(f"Task ID: {task_id}")
Node.js (axios)
const axios = require('axios');
const BASE_URL = 'https://api.ideal.house';
const API_KEY = 'your_api_key_here';
async function createInteriorRemodelTask() {
try {
const response = await axios.post(
`${BASE_URL}/api/v1/interiorRemodel/generate`,
{
imageUrl: 'https://example.com/interior.jpg',
prompt: 'modern warm remodel with clean built-in storage',
indoorTypeId: 'Interior Design_Interior Scene_Living Room',
indoorStyleId: 'Interior_Interior Style_Popular_Modern Country',
indoorElemId: 'Interior Design_Scene Elements_Living Room_Shelving,Interior Design_Scene Elements_Living Room_Coffee Table',
colorString: '[[174,238,238],[36,36,36],[117,64,95]]'
},
{
headers: {
APIKEY: API_KEY,
'Content-Type': 'application/json'
}
}
);
const taskId = response.data.data;
console.log('Task ID:', taskId);
return taskId;
} catch (error) {
console.error('Error:', error.response?.data || error.message);
}
}
createInteriorRemodelTask();
📤 الاستجابة#
{
"code": 0,
"message": "success",
"data": 1234567890123456789
}
2. الحصول على نتيجة المهمة#
نقطة النهاية
GET /api/v1/interiorRemodel/result
رؤوس الطلب
| الرأس | مطلوب | الوصف |
|---|---|---|
APIKEY | ✅ نعم | مفتاح مصادقة API الخاص بك |
معاملات الاستعلام
| المعامل | النوع | مطلوب | الوصف |
|---|---|---|---|
taskId | long | ✅ نعم | معرف المهمة المُرجع بواسطة نقطة نهاية الإنشاء |
📥 أمثلة الطلب#
cURL
curl -X GET "https://api.ideal.house/api/v1/interiorRemodel/result?taskId=1234567890123456789" \
-H "APIKEY: your_api_key_here"
Java (OkHttp)
import okhttp3.*;
import java.io.IOException;
public class InteriorRemodelResultExample {
private static final String BASE_URL = "https://api.ideal.house";
private static final String API_KEY = "your_api_key_here";
public static void main(String[] args) throws IOException {
OkHttpClient client = new OkHttpClient();
long taskId = 1234567890123456789L;
Request request = new Request.Builder()
.url(BASE_URL + "/api/v1/interiorRemodel/result?taskId=" + taskId)
.addHeader("APIKEY", API_KEY)
.get()
.build();
try (Response response = client.newCall(request).execute()) {
System.out.println("Response: " + response.body().string());
}
}
}
Python (requests)
import requests
import time
BASE_URL = "https://api.ideal.house"
API_KEY = "your_api_key_here"
headers = {"APIKEY": API_KEY}
task_id = 1234567890123456789
while True:
response = requests.get(
f"{BASE_URL}/api/v1/interiorRemodel/result",
headers=headers,
params={"taskId": task_id}
)
data = response.json()
result = data.get("data", {})
status = result.get("status")
print(f"Status: {status}, Progress: {result.get('percentage')}%, Queue: {result.get('waitNumber')}")
if status in ("Success", "Failed"):
break
time.sleep(3)
if status == "Success":
print("Result URL:", result["output"]["resultUrl"])
else:
print("Task ended with status:", status)
Node.js (axios)
const axios = require('axios');
const BASE_URL = 'https://api.ideal.house';
const API_KEY = 'your_api_key_here';
async function pollInteriorRemodelResult(taskId) {
const headers = { APIKEY: API_KEY };
while (true) {
const response = await axios.get(
`${BASE_URL}/api/v1/interiorRemodel/result`,
{
headers,
params: { taskId }
}
);
const result = response.data.data;
const { status, percentage, waitNumber } = result;
console.log(`Status: ${status} | Progress: ${percentage}% | Queue: ${waitNumber}`);
if (['Success', 'Failed'].includes(status)) {
if (status === 'Success') {
console.log('Result URL:', result.output.resultUrl);
console.log('Size:', result.output.width, 'x', result.output.height);
} else {
console.log('Task ended with status:', status);
}
break;
}
await new Promise(resolve => setTimeout(resolve, 3000));
}
}
pollInteriorRemodelResult(1234567890123456789n);
📤 مثال الاستجابة#
{
"code": 0,
"message": "success",
"data": {
"id": 1234567890123456789,
"status": "Success",
"waitNumber": 0,
"percentage": 100,
"input": {
"imageUrl": "https://example.com/interior.jpg",
"prompt": "modern warm remodel with clean built-in storage",
"indoorTypeId": "Interior Design_Interior Scene_Living Room",
"indoorStyleId": "Interior_Interior Style_Popular_Modern Country",
"colorString": "[[174,238,238],[36,36,36],[117,64,95]]"
},
"output": {
"resultUrl": "https://cdn.ideal.house/output/interior_remodel_result.jpg",
"width": 1024,
"height": 1024
}
}
}
الاستجابة (معالجة المهمة / في الطابور)
{
"code": 0,
"message": "success",
"data": {
"id": 1234567890123456789,
"status": "Processing",
"waitNumber": 1,
"percentage": 45,
"input": {
"imageUrl": "https://example.com/interior.jpg",
"prompt": "modern warm remodel with clean built-in storage"
},
"output": null
}
}
الاستجابة (فشل المهمة)
{
"code": 0,
"message": "success",
"data": {
"id": 1234567890123456789,
"status": "Failed",
"waitNumber": 0,
"percentage": 0,
"input": {
"imageUrl": "https://example.com/interior.jpg"
},
"output": null
}
}
📊 حالة المهمة#
| الحالة | الوصف |
|---|---|
Unprocessed | تم إنشاء المهمة وهي في انتظار الدور |
Processing | المهمة قيد التشغيل حالياً |
Success | اكتملت المهمة بنجاح |
Failed | فشلت المهمة ولم يتم إنتاج ناتج |
استعلم دوريًا كل 3-5 ثوانٍ. راجع حد مهام API.
❌ استجابات الخطأ#
| الرمز | الاسم | الوصف |
|---|---|---|
1011 | PARAM_ERROR | خطأ في معامل الطلب |
5002 | API_KEY_INVALID | مفتاح API غير صالح أو مفقود |
9010 | SCAN_TEXT_ERROR | فشل مراجعة محتوى التوجيه النصي |
9038 | PROHIBITED_CONTENT | تحتوي الصورة المُولدة على محتوى محظور |
9051 | COINS_NOT_ENOUGH | رصيد غير كافٍ |
للتعريفات الكاملة للأخطاء الشائعة، انظر مرجع رموز الأخطاء.