WhatsRBot Storage API Documentation

API for uploading files with temporary URLs that expire after 30 minutes

API Overview
Version 1.0.0

Base URL

https://storage.whatsrbot.xyz

Limitations

  • Maximum file size: 70MB
  • URL expiration: 30 minutes
  • Supported file types: All file types (documents, images, videos, audio, etc.)
  • Storage provider: Vercel Blob Storage

Endpoints

POST
/api/upload
Upload a file directly to Vercel Blob storage

Request Body

"FormData with 'file' field"
POST
/api/get-upload-url
Get a pre-signed URL for client-side upload to Vercel Blob

Request Body

{
  "filename": "string - Name of the file",
  "contentType": "string - MIME type of the file"
}
GET
/api/files
List all uploaded files

Request Body

POST
/api/delete
Delete a file from storage

Request Body

{
  "url": "string - URL of the file to delete"
}
Client-side Integration Example
How to use this API in your application
// Example: Upload a file and get a temporary URL
async function uploadFile(file) {
  // Create form data
  const formData = new FormData();
  formData.append('file', file);
  
  // Upload the file
  const response = await fetch("https://storage.whatsrbot.xyz/api/upload", {
    method: "POST",
    body: formData
  });
  
  const result = await response.json();
  
  if (!result.success) {
    throw new Error(result.error || "Upload failed");
  }
  
  // Return the temporary URL
  return result.url; // This URL will expire in 30 minutes
}