CMS API¶
Overview¶
The Content Management System (CMS) API provides endpoints for managing email templates, languages, QR codes, sections, and general templates within the Gustaffo Reservations system.
Base Path¶
CMS endpoints are organized under /cms
with specific controllers for different content types.
Authentication¶
Most CMS endpoints require authentication with appropriate permissions.
Content Management Process¶
The content management process follows these steps:
- Content Creation: Admin creates or uploads content via CMS API
- Content Validation: System validates content format and structure
- Metadata Assignment: Content is tagged with metadata (language, type, etc.)
- Version Control: System maintains version history of content
- Content Storage: Content is stored in the database
- Content Delivery: Content is delivered to appropriate systems
- Content Update: Content can be updated as needed
- Content Archiving: Outdated content can be archived
Template Resolution Process¶
The template resolution process follows these steps:
- Request Template: System requests a template by key and context
- Check for Hotel-Specific Template: System looks for a hotel-specific template
- Check for Language-Specific Default: If no hotel template, look for language default
- Use System Default: If no language default, use system default template
- Return Template: Return the resolved template
Controllers¶
Email Template Controller¶
Manages email templates for notifications and communications.
Base Path: /cms/email-templates
Key Operations: - Retrieve email templates by type and language - Create and update email templates - Manage template versions - Template preview and testing
Features: - Multi-language support - Template versioning - HTML and text templates - Variable substitution support
Language Controller¶
Handles language and localization settings.
Base Path: /cms/languages
Key Operations: - Retrieve supported languages - Manage language-specific content - Configure default languages - Language activation/deactivation
Features: - Multi-language content management - Language-specific templates - Locale-based formatting - Translation management
QR Code Controller¶
Manages QR code generation and configuration.
Base Path: /cms/qr-codes
Key Operations: - Generate QR codes for various purposes - Configure QR code properties - Manage QR code campaigns - Track QR code usage
Features: - Dynamic QR code generation - Customizable QR code styling - Usage analytics - Campaign management
Section Controller¶
Manages content sections and page layouts.
Base Path: /cms/sections
Key Operations: - Create and manage content sections - Configure section layouts - Manage section ordering - Section content editing
Features: - Flexible section management - Dynamic content sections - Section reordering - Content versioning
Template Controller¶
Handles general template management beyond email templates.
Base Path: /cms/templates
Key Operations: - Create and manage general templates - Template categorization - Template inheritance - Template compilation and rendering
Features: - Template hierarchy - Variable substitution - Template inheritance - Multi-format support
Common Features¶
Template Management¶
- Version control for all templates
- Template preview functionality
- Variable substitution support
- Multi-language template support
Content Organization¶
- Hierarchical content structure
- Content categorization
- Search and filtering capabilities
- Content relationship management
Localization¶
- Multi-language content support
- Locale-specific formatting
- Translation management
- Regional content variations
Business Rules¶
Template Creation¶
- Templates must follow defined structure
- Variable names must be properly formatted
- Templates are validated before saving
- Version history is maintained
Content Management¶
- Content changes are tracked and audited
- Published content is cached for performance
- Content approval workflows may apply
- Content rollback capabilities available
Localization Rules¶
- Default language must be specified
- All content should have default language version
- Translation completeness is tracked
- Missing translations fall back to default language
Integration Points¶
The CMS API integrates with: - Email notification systems - Multi-language support systems - Template rendering engines - Content delivery networks - Analytics and tracking systems