Themes API
विस्तृत थीम properties के साथ अपने फॉर्म्स के visual appearance को customize करें।
Themes API आपको किसी फॉर्म की पूरी visual थीम पढ़ने और अपडेट करने देता है। थीम properties फॉर्म और buttons, indicators, और options जैसे व्यक्तिगत UI elements दोनों के लिए colors, fonts, branding, और layout को नियंत्रित करती हैं।
सभी request और response bodies snake_case फ़ील्ड नामों का उपयोग करते हैं।
फॉर्म थीम प्राप्त करें
/api/v1/forms/:id/themeकिसी फॉर्म की सभी थीम properties प्राप्त करता है।
Path Parameters
idstringफॉर्म ID
Response
{
"theme_color": "#6366f1",
"background_color": "#0a0a0a",
"text_color": "#ffffff",
"answer_text_color": "#e5e7eb",
"placeholder_color": "#6b7280",
"button_color": "#6366f1",
"button_text_color": "#ffffff",
"title_color": "#f9fafb",
"description_color": "#d1d5db",
"option_text_color": "#e5e7eb",
"indicator_bg_color": "#1f2937",
"indicator_text_color": "#9ca3af",
"font_family": "Inter",
"font_family_answer": "Inter",
"font_family_button": "Inter",
"font_family_description": "Inter",
"font_family_option": "Inter",
"font_family_indicator": "Inter",
"question_font_size": "24px",
"custom_css": null,
"show_progress_bar": true,
"branding_logo_url": null,
"branding_footer_text": null,
"hide_branding": false,
"top_logo_url": null,
"top_logo_size": null,
"top_logo_alignment": "center",
"top_logo_css": null,
"watermark_css": null,
"welcome_title": "Welcome",
"welcome_description": null,
"welcome_button_text": "Start",
"thank_you_title": "Thank you!",
"thank_you_description": null
}
कोड उदाहरण
curl -X GET "https://api.nueform.io/api/v1/forms/665a1b2c3d4e5f6a7b8c9d0e/theme" \
-H "Authorization: Bearer YOUR_API_KEY"
फॉर्म थीम अपडेट करें
/api/v1/forms/:id/themeकिसी फॉर्म की थीम properties अपडेट करता है। केवल वे फ़ील्ड शामिल करें जिन्हें आप बदलना चाहते हैं। अनिर्दिष्ट फ़ील्ड अपने वर्तमान मान बनाए रखते हैं।
Path Parameters
idstringफॉर्म ID
Request Body
नीचे थीम Properties संदर्भ से थीम properties का कोई भी संयोजन शामिल करें।
Request उदाहरण
{
"theme_color": "#2563eb",
"background_color": "#ffffff",
"text_color": "#111827",
"button_color": "#2563eb",
"button_text_color": "#ffffff",
"font_family": "Poppins",
"question_font_size": "28px",
"show_progress_bar": true,
"hide_branding": true,
"top_logo_url": "https://cdn.example.com/logo.svg",
"top_logo_size": "140px",
"top_logo_alignment": "left"
}
Response
पूर्ण, अपडेट किया गया थीम object लौटाता है (फॉर्म थीम प्राप्त करें जैसा ही schema)।
कोड उदाहरण
curl -X PUT "https://api.nueform.io/api/v1/forms/665a1b2c3d4e5f6a7b8c9d0e/theme" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"theme_color": "#2563eb",
"background_color": "#ffffff",
"text_color": "#111827",
"font_family": "Poppins"
}'
थीम Properties संदर्भ
नीचे customization के लिए उपलब्ध थीम properties की पूरी सूची है।
Color Properties
theme_colorstringफॉर्म में उपयोग किया जाने वाला प्राथमिक accent color (focus rings, highlights)। डिफ़ॉल्ट: "#6366f1"
background_colorstringफॉर्म का बैकग्राउंड color। डिफ़ॉल्ट: "#0a0a0a"
text_colorstringप्राथमिक प्रश्न टेक्स्ट color। डिफ़ॉल्ट: null
answer_text_colorstringउत्तर inputs में टाइप किए गए टेक्स्ट का color। डिफ़ॉल्ट: null
placeholder_colorstringखाली inputs के लिए placeholder टेक्स्ट color। डिफ़ॉल्ट: null
button_colorstringsubmit/next buttons का बैकग्राउंड color। डिफ़ॉल्ट: null
button_text_colorstringsubmit/next buttons का टेक्स्ट color। डिफ़ॉल्ट: null
title_colorstringप्रश्न शीर्षक टेक्स्ट color (शीर्षकों के लिए text_color को override करता है)। डिफ़ॉल्ट: null
description_colorstringप्रश्न विवरण टेक्स्ट color। डिफ़ॉल्ट: null
option_text_colorstringmultiple-choice और dropdown options का टेक्स्ट color। डिफ़ॉल्ट: null
indicator_bg_colorstringstep/question number indicator का बैकग्राउंड color। डिफ़ॉल्ट: null
indicator_text_colorstringstep/question number indicator का टेक्स्ट color। डिफ़ॉल्ट: null
Font Properties
font_familystringप्रश्न शीर्षकों के लिए font family। कोई भी Google Font या system font support करता है। डिफ़ॉल्ट: null
font_family_answerstringउत्तर input टेक्स्ट के लिए font family। डिफ़ॉल्ट: null
font_family_buttonstringबटन labels के लिए font family। डिफ़ॉल्ट: null
font_family_descriptionstringप्रश्न विवरणों के लिए font family। डिफ़ॉल्ट: null
font_family_optionstringmultiple-choice option labels के लिए font family। डिफ़ॉल्ट: null
font_family_indicatorstringstep/question number indicators के लिए font family। डिफ़ॉल्ट: null
question_font_sizestringप्रश्न शीर्षकों के लिए font size (जैसे, "24px", "1.5rem")। डिफ़ॉल्ट: null
Layout और Progress
show_progress_barbooleanफॉर्म के शीर्ष पर progress bar दिखाना है या नहीं। डिफ़ॉल्ट: true
Branding
branding_logo_urlstringफुटर क्षेत्र में दिखाए जाने वाले branding logo का URL। डिफ़ॉल्ट: null
branding_footer_textstringफॉर्म footer में दिखाया जाने वाला custom टेक्स्ट। डिफ़ॉल्ट: null
hide_brandingbooleanडिफ़ॉल्ट NueForm branding footer छुपाएं। डिफ़ॉल्ट: false
top_logo_urlstringफॉर्म के शीर्ष पर दिखाए जाने वाले logo का URL। डिफ़ॉल्ट: null
top_logo_sizestringशीर्ष logo का आकार (जैसे, "120px", "80px")। डिफ़ॉल्ट: null
top_logo_alignmentstringशीर्ष logo का horizontal alignment: "left", "center", "right"। डिफ़ॉल्ट: null
top_logo_cssstringशीर्ष logo container पर लागू custom CSS। डिफ़ॉल्ट: null
watermark_cssstringbranding watermark पर लागू custom CSS। डिफ़ॉल्ट: null
स्वागत और धन्यवाद स्क्रीन
welcome_titlestringस्वागत स्क्रीन पर दिखाया जाने वाला शीर्षक टेक्स्ट। डिफ़ॉल्ट: null
welcome_descriptionstringस्वागत स्क्रीन पर विवरण टेक्स्ट। डिफ़ॉल्ट: null
welcome_button_textstringस्वागत स्क्रीन पर बटन label। डिफ़ॉल्ट: "Start"
thank_you_titlestringcompletion स्क्रीन पर शीर्षक टेक्स्ट। डिफ़ॉल्ट: "Thank you!"
thank_you_descriptionstringcompletion स्क्रीन पर विवरण टेक्स्ट। डिफ़ॉल्ट: null
Advanced
custom_cssstringफॉर्म renderer में inject किया गया arbitrary CSS। थीम properties द्वारा कवर न किए गए advanced customizations के लिए उपयोग करें। डिफ़ॉल्ट: null
Error Responses
इन endpoints द्वारा लौटाए गए मानक error responses।
Error Codes
401UnauthorizedAPI key गायब या अमान्य है
403Forbiddenटीम फॉर्म्स के लिए अपर्याप्त अनुमतियां
404Not Foundफॉर्म नहीं मिला
500Server ErrorInternal server error
Error उदाहरण
{
"error": "Form not found"
}