Rediafile API Sandbox User Guide
📖 1. Introduction
Welcome to the Rediafile Cloud API Sandbox — an interactive tool designed to help you understand, test, and integrate the Rediafile API into your applications. The Sandbox allows you to:
- 🔐 Authenticate and obtain access tokens
- 📤 Test endpoints for file uploads, downloads, and management
- 💻 Generate code snippets in Python, PHP, cURL, and JavaScript
- 📊 Simulate responses without affecting live data
🔑 2. Prerequisites
Before using the Sandbox, you need:
| Credential | Description | Where to Find It |
|---|---|---|
| Username | Your Rediafile account username or email | Account profile page |
| Account ID | Your unique numeric account identifier | Account Settings → API Access |
| API Keys | Key 1 & Key 2 for secure authentication | Account Settings → API Access |
🆔 3. Finding Your Account ID
Your Account ID is a unique number that identifies your Rediafile account. Here's how to find it:
- Log in to your Rediafile account
- Go to Account Settings → API Access
- Your Account ID is displayed at the top
- It looks like:
Account ID: 158642
🔐 4. Generating Your API Keys
Your API keys (Key 1 and Key 2) are essential for secure API integration. Here's how to generate them:
- Go to Account Settings → API Access
- Click "Generate New API Keys" or "Create New Keys"
- Name your keys (e.g., "Development Sandbox")
- Copy and store both keys immediately — Key 2 won't be shown again!
🧪 5. Using the API Sandbox
The Sandbox is available at /sandbox on your developer portal.
Here's how to use it step by step:
1 Authenticate & Get Your Access Token
- Select "Authenticate & Get Token" (
/authorizeendpoint) - Enter your credentials:
- Username: Your account username or email
- Password: Your account password
- Click "Send API Request"
- Copy the
access_tokenandaccount_idfrom the response
{
"status": 200,
"message": "Operation executed successfully.",
"data": {
"access_token": "tok_live_hsd0uq4z2rs",
"account_id": "acc_403ovt",
"expires_in": 3600,
"token_type": "Bearer"
}
}
2 Test Other Endpoints
Use your access_token and account_id to test endpoints like:
| Endpoint | Purpose |
|---|---|
/account/package |
Check your storage limits and plan details |
/file/upload |
Simulate file uploads |
/folder/create |
Create test folders |
/file/download |
Generate download links |
/file/url_upload_add |
Import files from remote URLs |
3 Generate Code Snippets
After filling in parameters, select your preferred language tab at the bottom of the Sandbox:
- PHP — Complete cURL implementation
- Python — Requests library code
- cURL — Command-line examples
- JavaScript — Fetch API examples
access_token
and account_id automatically.
💻 6. Code Snippets
Here are quick examples in each supported language:
🐍 Python
Python
import requests
1. Authenticate
auth = requests.post("https://rediafile.com/cloud/api/v2/authorize", data={
"username": "your_username",
"password": "your_password"
}).json()
token = auth["data"]["access_token"]
account = auth["data"]["account_id"]
2. Upload a file
with open("report.pdf", "rb") as f:
upload = requests.post(
"https://rediafile.com/cloud/api/v2/file/upload",
data={"access_token": token, "account_id": account},
files={"upload_file": f}
).json()
print("File URL:", upload["data"][0]["url"])
🐘 PHP
PHP
<?php
$ch = curl_init("https://rediafile.com/cloud/api/v2/authorize");
$data = [
"username" => "your_username",
"password" => "your_password"
];
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
📡 cURL
cURL
curl -X POST "https://rediafile.com/cloud/api/v2/authorize" \
-d "username=your_username" \
-d "password=your_password"
🟨 JavaScript (Fetch)
JavaScript
const params = new URLSearchParams();
params.append("username", "your_username");
params.append("password", "your_password");
const response = await fetch("https://rediafile.com/cloud/api/v2/authorize", {
method: "POST",
headers: { "Content-Type": "application/x-www-form-urlencoded" },
body: params
});
const data = await response.json();
console.log(data);
🔧 7. Troubleshooting
| Issue | Solution |
|---|---|
| 401 "Could not authenticate user" | Check your username and password |
| 401 "Invalid access_token" | Token expired. Re-authenticate via /authorize |
| 404 "Account ID not found" | Go to Account Settings → API Access to find it |
| 429 "Rate limit reached" | Reduce request frequency |
| 400 "File too large" | Check max_upload_size via /account/package |
| 500 "Server error" | Retry later or contact support |
_status field in the JSON response.
If it's "error", read the response field for details.
✅ 8. Best Practices
All requests must use HTTPS. Your credentials and tokens are sensitive data.
An access_token is valid for 1 hour. Store it and reuse it for
multiple requests instead of generating a new token each time.
Always check the response status and _status field.
Implement proper error handling in your application.
Chunked uploads are not currently supported. For large files,
use /file/url_upload_add or check your plan's
max_upload_size.
📋 9. Quick Reference Card
curl -X POST https://rediafile.com/cloud/api/v2/authorize \ -d "username=your_username" \ -d "password=your_password"
curl -X POST https://rediafile.com/cloud/api/v2/file/upload \ -F "access_token=YOUR_TOKEN" \ -F "account_id=YOUR_ACCOUNT_ID" \ -F "upload_file=@/path/to/file.pdf"
curl -X POST https://rediafile.com/cloud/api/v2/file/download \ -d "access_token=YOUR_TOKEN" \ -d "account_id=YOUR_ACCOUNT_ID" \ -d "file_id=12345"
curl -X POST https://rediafile.com/cloud/api/v2/account/package \ -d "access_token=YOUR_TOKEN" \ -d "account_id=YOUR_ACCOUNT_ID"
© 2026 Rediafile. All rights reserved.
Need help? Contact support@rediafile.com
¿Necesitas ayuda?
Prueba los endpoints en vivo en el sandbox interactivo.