API Thèmes
Personnaliser l'apparence visuelle de vos formulaires avec des propriétés de thème détaillées.
L'API Thèmes vous permet de lire et mettre à jour le thème visuel complet d'un formulaire. Les propriétés de thème contrôlent les couleurs, les polices, l'image de marque et la mise en page pour le formulaire lui-même et les éléments d'interface individuels comme les boutons, les indicateurs et les options.
Tous les corps de requête et de réponse utilisent des noms de champs en snake_case.
Obtenir le thème du formulaire
/api/v1/forms/:id/themeRécupère toutes les propriétés de thème d'un formulaire.
Paramètres de chemin
idstringL'identifiant du formulaire
Réponse
{
"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
}
Exemples de code
curl -X GET "https://api.nueform.io/api/v1/forms/665a1b2c3d4e5f6a7b8c9d0e/theme" \
-H "Authorization: Bearer YOUR_API_KEY"
Mettre à jour le thème du formulaire
/api/v1/forms/:id/themeMet à jour les propriétés de thème d'un formulaire. Incluez uniquement les champs que vous souhaitez modifier. Les champs non spécifiés conservent leurs valeurs actuelles.
Paramètres de chemin
idstringL'identifiant du formulaire
Request Body
Incluez toute combinaison de propriétés de thème de la Référence des propriétés de thème ci-dessous.
Exemple de requête
{
"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"
}
Réponse
Renvoie l'objet thème complet et mis à jour (même schéma que Obtenir le thème du formulaire).
Exemples de code
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"
}'
Référence des propriétés de thème
Voici la liste complète des propriétés de thème disponibles pour la personnalisation.
Propriétés de couleur
theme_colorstringPrimary accent color used throughout the form (focus rings, highlights). Default: "#6366f1"
background_colorstringForm background color. Default: "#0a0a0a"
text_colorstringPrimary question text color. Default: null
answer_text_colorstringColor of text typed into answer inputs. Default: null
placeholder_colorstringPlaceholder text color for empty inputs. Default: null
button_colorstringBackground color for submit/next buttons. Default: null
button_text_colorstringText color for submit/next buttons. Default: null
title_colorstringQuestion title text color (overrides text_color for titles). Default: null
description_colorstringQuestion description text color. Default: null
option_text_colorstringText color for multiple-choice and dropdown options. Default: null
indicator_bg_colorstringBackground color for the step/question number indicator. Default: null
indicator_text_colorstringText color for the step/question number indicator. Default: null
Propriétés de police
font_familystringFont family for question titles. Supports any Google Font or system font. Default: null
font_family_answerstringFont family for answer input text. Default: null
font_family_buttonstringFont family for button labels. Default: null
font_family_descriptionstringFont family for question descriptions. Default: null
font_family_optionstringFont family for multiple-choice option labels. Default: null
font_family_indicatorstringFont family for step/question number indicators. Default: null
question_font_sizestringFont size for question titles (e.g., "24px", "1.5rem"). Default: null
Mise en page et progression
show_progress_barbooleanWhether to display a progress bar at the top of the form. Default: true
Image de marque
branding_logo_urlstringURL for a branding logo displayed in the footer area. Default: null
branding_footer_textstringCustom text displayed in the form footer. Default: null
hide_brandingbooleanHide the default NueForm branding footer. Default: false
top_logo_urlstringURL for a logo displayed at the top of the form. Default: null
top_logo_sizestringSize of the top logo (e.g., "120px", "80px"). Default: null
top_logo_alignmentstringHorizontal alignment of the top logo: "left", "center", "right". Default: null
top_logo_cssstringCustom CSS applied to the top logo container. Default: null
watermark_cssstringCustom CSS applied to the branding watermark. Default: null
Écrans d'accueil et de remerciement
welcome_titlestringTitle text displayed on the welcome screen. Default: null
welcome_descriptionstringDescription text on the welcome screen. Default: null
welcome_button_textstringButton label on the welcome screen. Default: "Start"
thank_you_titlestringTitle text on the completion screen. Default: "Thank you!"
thank_you_descriptionstringDescription text on the completion screen. Default: null
Avancé
custom_cssstringArbitrary CSS injected into the form renderer. Use for advanced customizations that theme properties do not cover. Default: null
Réponses d'erreur
Réponses d'erreur standard renvoyées par ces points d'accès.
Codes d'erreur
401UnauthorizedClé API manquante ou invalide
403ForbiddenPermissions insuffisantes pour les formulaires d'équipe
404Not FoundFormulaire introuvable
500Server ErrorErreur interne du serveur
Exemple d'erreur
{
"error": "Form not found"
}