Generate Public URL

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

HeaderTypeRequiredDescription
x-api-keystringYesYour 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

FieldTypeRequiredDescription
common_filefileYesThe 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_KEY instead of publishing a real API key.


Response

Success — 200

{
  "success": true,
  "url": "https://your-public-url.com/uploads/Response_1.png"
}

Response Parameters

FieldTypeDescription
successbooleanIndicates whether the file upload was successful
urlstringPublicly 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

ErrorDescription
File missingcommon_file was not provided
Invalid fileThe uploaded file is invalid or unsupported
File too largeFile exceeds the allowed size
UnauthorizedAPI key is missing or invalid
Upload failedFile could not be uploaded