Generates a publicly accessible URL for an uploaded media file. This URL can then be used in WhatsApp messages where a publicly accessible media URL is required.
Endpoint
POST /api/common/v1/upload-file
Base URL
https://api.rampwin.com
Headers
| Header | Type | Required | Description |
|---|---|---|---|
x-api-key | string | Yes | Your Rampwin API key |
Request
The API accepts the file using multipart/form-data.
cURL
curl --location 'https://api.rampwin.com/api/common/v1/upload-file' \
--header 'x-api-key: YOUR_API_KEY' \
--form 'common_file=@"/path/to/file.png"'
Request Parameters
| Field | Type | Required | Description |
|---|---|---|---|
common_file | file | Yes | The file that needs to be uploaded |
Example Request
curl --location 'https://api.rampwin.com/api/common/v1/upload-file' \
--header 'x-api-key:YOUR_API_KEY' \
--form 'common_file=@"/Users/apple/Downloads/Response_1.png"'
Security Note: For public API documentation, use
YOUR_API_KEYinstead of publishing a real API key.
Response
Success — 200
{
"success": true,
"url": "https://your-public-url.com/uploads/Response_1.png"
}
Response Parameters
| Field | Type | Description |
|---|---|---|
success | boolean | Indicates whether the file upload was successful |
url | string | Publicly accessible URL generated for the uploaded file |
How It Works
Step 1 — Upload File
Send the file using the common_file form-data field.
Step 2 — Receive Public URL
The API returns a publicly accessible URL for the uploaded file.
Step 3 — Use the URL
Use the returned URL in APIs that require publicly accessible media.
Flow:
File → Upload API → Public URL
Error Responses
400 — Bad Request
{
"success": false,
"message": "Invalid file"
}
401 — Unauthorized
{
"success": false,
"message": "Unauthorized"
}
413 — File Too Large
{
"success": false,
"message": "File size exceeds the allowed limit"
}
Common Errors
| Error | Description |
|---|---|
File missing | common_file was not provided |
Invalid file | The uploaded file is invalid or unsupported |
File too large | File exceeds the allowed size |
Unauthorized | API key is missing or invalid |
Upload failed | File could not be uploaded |
