Skip to main content
The form update system allows you to update existing form metadata, appearance, and configuration. You can modify the form name, description, banner, logo, screenshot, rating, and other settings. Updates support partial modifications - only the fields you provide will be updated, while others remain unchanged.

API Endpoint

Endpoint: POST /api/common/update-object Content-Type: multipart/form-data Authentication: Required (Token header: token or api_access_token)

Request Structure

The endpoint accepts a multipart/form-data request with the following structure:
{
  "object_id": 123,                      // Required
  "object_name": "Updated Form Name",   // Optional
  "form_description": "Updated description", // Optional
  "rating": 4.5,                        // Optional: Rating value (0.00-5.00)
  "form_banner": "image_file_or_path",  // Optional: Banner image file
  "form_logo": "image_file_or_path",    // Optional: Logo image file
  "screenshot": "image_file_or_path"   // Optional: Screenshot image file
}
File Uploads:
  • form_banner - Banner image file (PNG, JPG, JPEG, SVG, GIF)
  • form_logo - Logo image file (PNG, JPG, JPEG, SVG, GIF)
  • screenshot - Screenshot image file (PNG, JPG, JPEG, SVG, GIF)

cURL Example

curl -X POST "https://your-api-domain.com/api/common/update-object" \
  -H "token: YOUR_AUTH_TOKEN" \
  -F "object_id=123" \
  -F "object_name=Updated Contact Form" \
  -F "form_description=Updated description for the contact form" \
  -F "rating=4.5" \
  -F "form_banner=@/path/to/new-banner.png" \
  -F "form_logo=@/path/to/new-logo.png" \
  -F "screenshot=@/path/to/screenshot.png"
Note: Remove any fields you don’t need to update. Only object_id is required. All other fields are optional and only provided fields will be updated.

Response

Success Response

Status Code: 200 OK
{
  "message": "OBJECT_UPDATED_SUCCESSFULLY"
}

Error Responses

422 - Validation Error

Status Code: 422 Unprocessable Entity
{
  "error": true,
  "code": 422,
  "message": "Object Details is missing",
  "data": {}
}
Common Error Messages:
  • "Object Details is missing" - Required field object_id is missing
  • "Object ID is invalid" - Invalid object ID format
  • "OBJECT_NOT_FOUND" - Form with provided ID does not exist or doesn’t belong to your workspace
  • "INVALID_FORM_BANNER_FILE_TYPE" - Banner file type is not supported (use PNG, JPG, JPEG, SVG, or GIF)
  • "INVALID_FORM_LOGO_FILE_TYPE" - Logo file type is not supported (use PNG, JPG, JPEG, SVG, or GIF)
  • "INVALID_SCREENSHOT_FILE_TYPE" - Screenshot file type is not supported (use PNG, JPG, JPEG, SVG, or GIF)
  • "FORM_BANNER_FILE_REQUIRED" - Banner file field is present but empty
  • "FORM_LOGO_FILE_REQUIRED" - Logo file field is present but empty
  • "SCREENSHOT_FILE_REQUIRED" - Screenshot file field is present but empty

401 - Authentication Error

Status Code: 401 Unauthorized
{
  "error": true,
  "code": 401,
  "message": "Invalid Auth Key or Session Expired",
  "data": {}
}

500 - Server Error

Status Code: 500 Internal Server Error
{
  "error": true,
  "code": 500,
  "message": "Internal server error",
  "data": {}
}

Error Codes

Status CodeError CodeDescription
200-Success
401AUTH_REQUIREDAuthentication required - Missing or invalid token
401AUTH_INVALIDInvalid authentication token or session expired
422VALIDATION_ERRORValidation failed - Check required fields and data format
422MISSING_FIELDRequired field missing
422INVALID_FORMATInvalid data format or type
422OBJECT_NOT_FOUNDForm with provided ID does not exist
422INVALID_FORM_BANNER_FILE_TYPEBanner file type not supported
422INVALID_FORM_LOGO_FILE_TYPELogo file type not supported
422INVALID_SCREENSHOT_FILE_TYPEScreenshot file type not supported
422FORM_BANNER_FILE_REQUIREDBanner file field is empty
422FORM_LOGO_FILE_REQUIREDLogo file field is empty
422SCREENSHOT_FILE_REQUIREDScreenshot file field is empty
500SERVER_ERRORInternal server error

Update Behavior

Partial Updates

  • Only fields you provide will be updated
  • Fields not included in the request remain unchanged
  • You can update specific fields without affecting others
Example:
// Update only form name
{
  "object_id": 123,
  "object_name": "New Name"
}
// All other fields remain unchanged

File Upload Behavior

  1. New File Upload: If you upload a new file, it replaces the existing file
  2. File Path Provided: If you provide a file path, the system uses that path (assumes file already exists)
  3. Neither Provided: If you don’t provide a file or path, the existing file is retained

Automatic Updates

The following fields are automatically updated by the system:
  • UPDATED_ON - Set to current timestamp
  • UPDATED_BY - Set to the authenticated user ID
  • IP_ADDRESS - Recorded from the request
  • USER_AGENT - Recorded from the request headers

File Upload Guidelines

Supported File Types

  • Banner, Logo, Screenshot: PNG, JPG, JPEG, SVG, GIF

File Upload Requirements

  1. File Size: Ensure files are reasonably sized for web use
  2. File Format: Only image formats listed above are accepted
  3. Validation: The system validates both file extension and MIME type
  4. Storage: Files are securely stored in company-specific directories:
    • Banner images: {company_id}/forms/banner
    • Logo images: {company_id}/forms/logo
    • Screenshot images: {company_id}/forms/screenshot

Important Notes

  • object_id is required - all other fields are optional
  • Partial updates are supported - only include fields you want to change
  • File uploads replace existing files when new files are provided
  • Updates are transactional - if any step fails, the entire operation is rolled back
  • Cache is automatically cleared after successful updates
  • Updates are immediately reflected in the system
  • The system automatically tracks who made the update and when