đŸŽŦ Media Manager

Professional media conversion and storage management

🔄 Media Converter
📤 File Uploader
🌐 HTTP Request
🔧 API Reference

Media Converter

Convert images and videos to optimized formats with quality control.

85
🔄 Loop Forever
Toggle to choose whether videos and animations should loop continuously or end on the last frame
Specify a folder path in Google Cloud Storage for the converted file

Converting media... Please wait.

File Uploader

Upload any file type directly to Google Cloud Storage without conversion.

Uploading file... Please wait.

🌐 HTTP Request Tool

Make any HTTP request with full customization. Perfect for API testing and integration.

Send the response to this URL after successful request
Folder path in Google Cloud Storage for storing base64 images as PNG files

Sending request... Please wait.

📚 API Reference

Integrate Media Manager into your applications with our comprehensive RESTful API.

🔄 Media Converter API

Convert images and videos with cropping, quality control, and loop settings.

POST https://media-manager-yf55zpjhia-uc.a.run.app

📤 File Uploader API

Upload any file type directly to Google Cloud Storage.

POST https://media-manager-yf55zpjhia-uc.a.run.app

🌐 HTTP Request API

Make HTTP requests with automatic base64 image processing and storage.

POST https://media-manager-yf55zpjhia-uc.a.run.app

🔄 Media Converter API

Endpoint: POST https://media-manager-yf55zpjhia-uc.a.run.app

Parameters

Parameter Type Required Description
file_url string One of file_url or file URL of the file to convert
file string One of file_url or file Base64 encoded file data
quality integer No (default: 85) Quality 1-100 for WebP, 0-63 for WebM
output_format string No (default: webp) webp or webm
crop_ratio string No Aspect ratio (e.g., "1:1", "16:9", "custom")
gcs_path string No Storage folder path in Google Cloud Storage
loop boolean No (default: true) For videos/animations - true = loop forever, false = end static on last frame

📐 Available Crop Ratios

  • 1:1 - Square (Instagram, profile pictures)
  • 16:9 - Widescreen (YouTube, modern displays)
  • 4:3 - Standard (traditional displays)
  • 3:2 - Photo (DSLR cameras)
  • 9:16 - Portrait (mobile stories, TikTok)
  • 21:9 - Ultrawide (cinema, gaming)
  • Custom - Any ratio (e.g., "3:1", "1:2")

🔄 Loop Control (Videos/Animations)

  • loop: true - Animation loops forever (default)
  • loop: false - Animation ends static on the last frame
Note: Loop control only applies to video and animation files (GIF, MP4, etc.)

Example Requests

Basic Image Conversion
curl -X POST https://media-manager-yf55zpjhia-uc.a.run.app \
  -H "Content-Type: application/json" \
  -d '{
    "file_url": "https://example.com/image.png",
    "quality": 85,
    "output_format": "webp"
  }'
Image with Square Crop
curl -X POST https://media-manager-yf55zpjhia-uc.a.run.app \
  -H "Content-Type: application/json" \
  -d '{
    "file_url": "https://example.com/image.png",
    "quality": 85,
    "output_format": "webp",
    "crop_ratio": "1:1",
    "gcs_path": "social-media/instagram"
  }'
Video with Loop Control
curl -X POST https://media-manager-yf55zpjhia-uc.a.run.app \
  -H "Content-Type: application/json" \
  -d '{
    "file_url": "https://example.com/animation.gif",
    "quality": 85,
    "output_format": "webp",
    "loop": false,
    "gcs_path": "animations/static"
  }'

Response Format

{
  "success": true,
  "webp_url": "https://storage.googleapis.com/...",
  "file_url": "https://storage.googleapis.com/...",
  "filename": "converted_20241201_143022.webp",
  "file_type": "image",
  "output_format": "webp",
  "quality": 85,
  "crop_ratio": "1:1",
  "loop": true,
  "original_size": 1024000,
  "converted_size": 512000,
  "compression_ratio": 50.0,
  "bucket": "onsitetrainer-uploads",
  "gcs_path": "gs://onsitetrainer-uploads/social-media/instagram/converted_20241201_143022.webp",
  "expires_in": "permanent (public URL)"
}

📤 File Uploader API

Endpoint: POST https://media-manager-yf55zpjhia-uc.a.run.app

Parameters

Parameter Type Required Description
file string Yes Base64 encoded file data
filename string No Custom filename
content_type string No MIME type (auto-detected if not provided)
gcs_path string No Storage folder path

Example Request

curl -X POST https://media-manager-yf55zpjhia-uc.a.run.app \
  -H "Content-Type: application/json" \
  -d '{
    "file": "base64_encoded_file_data",
    "filename": "document.pdf",
    "content_type": "application/pdf",
    "gcs_path": "documents/reports"
  }'

Response Format

{
  "success": true,
  "file_url": "https://storage.googleapis.com/...",
  "filename": "document.pdf",
  "bucket": "onsitetrainer-uploads",
  "gcs_path": "gs://onsitetrainer-uploads/documents/reports/document.pdf",
  "size": 1024000,
  "content_type": "application/pdf"
}

🌐 HTTP Request API

Endpoint: POST https://media-manager-yf55zpjhia-uc.a.run.app

Parameters

Parameter Type Required Description
method string Yes HTTP method (GET, POST, PUT, DELETE)
url string Yes Target URL
headers object No HTTP headers
body string No Request body
webhook_url string No Webhook URL for response

Base64 Image Processing

When using HTTP Request Forwarding, if the response contains base64 image data, it will automatically be:

  • Detected in the response body
  • Converted to PNG format
  • Uploaded to Google Cloud Storage
  • Made available via public URL

Example Request - OpenAI Image Generation

curl -X POST https://media-manager-yf55zpjhia-uc.a.run.app \
  -H "Content-Type: application/json" \
  -d '{
    "method": "POST",
    "url": "https://api.openai.com/v1/images/generations",
    "headers": {
      "Content-Type": "application/json",
      "Authorization": "Bearer YOUR_API_KEY"
    },
    "body": "{\"model\":\"gpt-image-1\",\"prompt\":\"A red circle\",\"n\":1,\"size\":\"1024x1024\"}",
    "webhook_url": "https://your-webhook.com/callback"
  }'

Response Format

{
  "success": true,
  "status_code": 200,
  "response_time": 1500,
  "response_headers": {...},
  "response_body": {...},
  "processed_images": [
    {
      "original_field": "data[0].b64_json",
      "png_url": "https://storage.googleapis.com/bucket/generated_image.png",
      "filename": "generated_image.png"
    }
  ]
}

âš ī¸ Error Handling

All API endpoints return consistent error responses:

Error Response Format

{
  "success": false,
  "error": "Error description"
}

Common Error Codes

Error Description Solution
400 Invalid request parameters Check parameter types and required fields
404 File not found Verify file URL is accessible
500 Internal server error Contact support with request details

💾 Storage Information

  • Default Bucket: {PROJECT_ID}-uploads
  • Default Path: Root of bucket (if no gcs_path specified)
  • File Access: Public URLs for all uploaded files
  • File Naming: Automatic unique naming with timestamps

Supported Formats

Input Formats
  • Images: PNG, JPG, JPEG, GIF, BMP, TIFF, WEBP
  • Videos: MP4, AVI, MOV, MKV, FLV, WMV, WEBM
  • Animations: GIF, APNG
Output Formats
  • Images: WEBP (with quality control)
  • Videos: WEBM, MP4 (with quality control)
  • Animations: WEBP (with loop control)

Rate Limits & Quotas

  • File Size: Up to 100MB per file
  • Processing Time: Up to 120 seconds
  • Concurrent Requests: Up to 10 simultaneous
  • Storage: Unlimited (Google Cloud Storage limits apply)