GET /image/all – Get All Images Grouped by Folder

Endpoint Details

Method: GET

URL: https://le-crown-interiors-backend.onrender.com/image/all

Authentication: None Required

Request Body: Must be empty {} (empty object) or null

Description: Returns all image data grouped by their folder name such as "offers", "hero", etc.

Response Structure

The response is a JSON object where keys are folder names and values are arrays of image objects.


{
  "offers": [
    {
      "img": {
        "public_id": "lecrowninteriors/hsrtfdyvbtp6lvkptsux",
        "url": "http://res.cloudinary.com/dflgxymvs/image/upload/v1746063750/lecrowninteriors/hsrtfdyvbtp6lvkptsux.avif",
        "dimensions": {
          "width": 369,
          "height": 553
        }
      },
      "name": "modern-living-room",
      "title": "Elegant & Functional Living Spaces",
      "content": "Transform your living room into a contemporary haven with sleek furniture, layered lighting, and earthy textures.",
      "description": "Our modern living room designs blend comfort with luxury, utilizing open layouts, neutral tones, and handpicked decor accents to elevate your space."
    },
    {
      "img": {
        "public_id": "lecrowninteriors/zelf1fjtfx9greltub3y",
        "url": "http://res.cloudinary.com/dflgxymvs/image/upload/v1746063707/lecrowninteriors/zelf1fjtfx9greltub3y.avif",
        "dimensions": {
          "width": 930,
          "height": 1316
        }
      },
      "name": "luxury-bedroom",
      "title": "Serene Bedroom Interiors",
      "content": "Create a peaceful retreat with custom-designed wardrobes, warm lighting, and plush textures.",
      "description": "Designed for comfort and style, our luxury bedrooms feature soft color palettes, smart storage, and inviting ambiance to ensure restful nights."
    },
    {
      "img": {
        "public_id": "lecrowninteriors/x2dwiec2g48ugg0sdmmm",
        "url": "http://res.cloudinary.com/dflgxymvs/image/upload/v1746041229/lecrowninteriors/x2dwiec2g48ugg0sdmmm.avif",
        "dimensions": {
          "width": 4480,
          "height": 2520
        }
      },
      "name": "open-concept-kitchen",
      "title": "Contemporary Kitchen Designs",
      "content": "Maximize space and efficiency with open shelving, clean lines, and modern finishes.",
      "description": "Our kitchen interiors are tailored for both form and function, using minimalist aesthetics and durable materials to support your culinary lifestyle."
    }
  ],
  "hero": [
    {
      "img": {
        "public_id": "lecrowninteriors/jfqzmfj9xkb2wuoke3zy",
        "url": "http://res.cloudinary.com/dflgxymvs/image/upload/v1746062516/lecrowninteriors/jfqzmfj9xkb2wuoke3zy.avif",
        "dimensions": {
          "width": 1799,
          "height": 1200
        }
      },
      "name": "nithya-ganesh-portrait-1",
      "title": "Creative Director",
      "content": "With a passion for timeless design and innovation, Nithya leads our creative vision with elegance and precision.",
      "description": "Nithya Ganesh, our lead designer, brings over a decade of experience crafting bespoke interiors that balance beauty with functionality."
    },
    {
      "img": {
        "public_id": "lecrowninteriors/iu5nczfvfhecjqytzmhn",
        "url": "http://res.cloudinary.com/dflgxymvs/image/upload/v1746062475/lecrowninteriors/iu5nczfvfhecjqytzmhn.avif",
        "dimensions": {
          "width": 1920,
          "height": 1102
        }
      },
      "name": "nithya-ganesh-portrait-2",
      "title": "Founder & Visionary",
      "content": "Driven by excellence and innovation, Nithya transforms everyday spaces into works of art.",
      "description": "As the founder of LeCrown Interiors, Nithya is committed to delivering personalized design solutions that reflect each client's unique style and story."
    }
  ]
}



      

Image Object Schema

{
  "img": {
    "public_id": "string",               // Cloudinary public ID
    "url": "string",                     // Full Cloudinary URL (AVIF)
    "dimensions": {
      "width": number,                  // Pixel width
      "height": number                  // Pixel height
    }
  },
  "name": "string",                      // Uploader-provided or autogenerated
  "title": "string",                     // Custom title
  "content": "string",                   // Content field (short description)
  "description": "string"                // Full description (up to 5000 chars)
}
      

Integration Notes

OTP API – Send & Verify OTP

Available Routes

Common Validation:

BrowserData = { userAgent: navigator.userAgent, language: navigator.language }
ClientId = { const fp = await FingerprintJS.load(); const res = await fp.get(); return res.visitorId; }
Headers: { 'Content-Type': 'application/json' }
Credentials: include
Body: { userBrowserData, fingerprint, phoneNumber or userOtp }
                        {
                          "status": false,
                          "message": "Invalid headers"
                        }
                        
                        {
                          "status": false,
                          "message": "Missing browser data"
                        }
                        
                        {
                          "status": false,
                          "message": "User agent mismatch"
                        }
                        
                        {
                          "status": false,
                          "message": "Language mismatch"
                        }
                        

1. POST /otp/sendotp

Description: Generates and sends a 6-digit OTP. Sets a secure otpToken cookie on success.

Request Body:

                {
                  "phone": "9876543210"
                }
                        

Success Response:

                {
                  "status": true,
                  "message": "OTP sent"
                }
                        

Failure Cases:

                // Invalid or missing phone
                {
                  "status": false,
                  "message": "Invalid phone number"
                }
                
                // Rate limit exceeded
                {
                  "status": false,
                  "message": "Too many attempts. Try again later"
                }
                
                // OTP already pending
                {
                  "status": false,
                  "message": "OTP already pending"
                }
                
                // Retry within a minute
                {
                  "status": false,
                  "message": "Wait before retrying"
                }
                
                // Blocked device or user
                {
                  "status": false,
                  "message": "Access denied"
                }
                
                // Already authorized device
                {
                  "status": true,
                  "message": "Already Authorized."
                }
                
                // Existing registration
                {
                  "status": true,
                  "message": "Authorized"
                }
                
                // Server error
                {
                  "status": false,
                  "message": "Internal error"
                }
                        

2. POST /otp/verifyotp

Description: Verifies the OTP from the user. On success, returns user session data and clears otpToken.

Request Body:

                {
                  "otp": "123456"
                }
                        

Success Response:

                {
                  "status": true,
                  "message": "OTP verified",
                  "user": {
                    "phone": "9876543210",
                    ...
                  }
                }
                        

Failure Cases:

                // Wrong OTP
                {
                  "status": false,
                  "message": "Invalid or expired OTP"
                }
                
                // Missing OTP
                {
                  "status": false,
                  "message": "OTP is required"
                }
                
                // Missing token
                {
                  "status": false,
                  "message": "Token missing"
                }
                
                // Invalid session
                {
                  "status": false,
                  "message": "Invalid session"
                }
                
                // Too many failed attempts
                {
                  "status": false,
                  "message": "Too many attempts"
                }
                        

3. GET /otp/deleteall

Description: Deletes all records in VerifiedUser and AuthAttempt collections. Clears cookies. Use only during testing.

Success Response:

                {
                  "status": true,
                  "message": "All data deleted"
                }
                        

Security & Validation

Integration Notes