API
تصميم قالب من موجز
يبني المصمم قالبًا جديدًا من الكتل مما تكتبه.
POST/templates/design
ينفّذ الاستدعاء الحقيقي على مساحة عملك.
POST /templates/design
يبني المصمم قالبًا جديدًا من الكتل مما تكتبه.
مثال
يتطلب templates:write. يحوي brief كل ما يجب أن يقوله التصميم وكيف يبدو. ويبني starter على تصميم بداية، ويضع imageFileIds حتى عشر صور، وينشره publish فورًا. يرد بـ 201 مع القالب وdesign.
curl -X POST "$OE/templates/design" -H "$AUTH" -H "Content-Type: application/json" \ -d '{ "name": "Spring launch", "brief": "A launch email for our spring collection: a hero image, three product cards and a button to the shop. Green and cream, friendly tone." }'{ "object": "template", "id": "tpl_8f3a1c2e9b7d4a60", "name": "Spring launch", "slug": "spring-launch", "status": "draft", "publishedVersion": null, "latestVersion": 1, "design": { "subject": "Spring is here", "notes": [], "imageProblems": [] }}يستهلك إجراء ذكاء اصطناعي واحدًا وقد يستغرق حتى دقيقة. والتصميم الذي يتعذر جعله صالحًا يعطي 422 invalid_template، ومساحة العمل التي نفدت إجراءاتها تعطي 429 ai_quota_exceeded.
الصورة التي لا يصل إليها مفتاح مقصور على بعض العناوين تُستبعد وتُذكر في design.imageProblems.