दस्तावेज़ पर जाएँ
API

ब्रीफ़ से टेम्पलेट डिज़ाइन करें

डिज़ाइनर आपके लिखे से एक नया ब्लॉक टेम्पलेट बनाता है।

POST/templates/design

असली कॉल आपके वर्कस्पेस पर चलाता है।

POST /templates/design

डिज़ाइनर आपके लिखे से एक नया ब्लॉक टेम्पलेट बनाता है।

उदाहरण

templates:write चाहिए। brief में वह सब है जो डिज़ाइन को कहना है और जैसा दिखना है। starter किसी स्टार्टर डिज़ाइन पर बनाता है, imageFileIds दस तक इमेज रखता है, और publish तुरंत लाइव करता है। टेम्पलेट और design के साथ 201 लौटाता है।

curl
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": []  }}

यह एक AI ऐक्शन खर्च करता है और एक मिनट तक ले सकता है। जो डिज़ाइन मान्य न बन सके वह 422 invalid_template है, और जिस वर्कस्पेस के AI ऐक्शन ख़त्म हो गए हों वह 429 ai_quota_exceeded।

कुछ पतों तक सीमित कुंजी जिस इमेज तक नहीं पहुँचती, वह छोड़ दी जाती है और design.imageProblems में बताई जाती है।

संदर्भ