✓ CLEAN ROUTER v2.0 https://www.developers.rediafile.com/es/docs/rediafile-api-sandbox-user-guide?slug=rediafile-api-sandbox-user-guide
📖 Documentación

Rediafile API Sandbox User Guide

v2.0 Actualizado: 31 ago. 2026

📖 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
💡 What is the Sandbox? The Sandbox is a mock environment that simulates API responses. It allows you to test integration logic and understand request/response structures safely.

🔑 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
⚠️ Important: You need a Rediafile account to use the Sandbox. Sign up at rediafile.com if you don't have one.

🆔 3. Finding Your Account ID

Your Account ID is a unique number that identifies your Rediafile account. Here's how to find it:

  1. Log in to your Rediafile account
  2. Go to Account SettingsAPI Access
  3. Your Account ID is displayed at the top
  4. It looks like: Account ID: 158642
✅ Pro Tip: Copy your Account ID and keep it handy. You'll need it for most API requests.
🔐 API Access Account ID: 158642 📋 Copy Your API Keys: Key 1: abcd1234...

🔐 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:

  1. Go to Account SettingsAPI Access
  2. Click "Generate New API Keys" or "Create New Keys"
  3. Name your keys (e.g., "Development Sandbox")
  4. Copy and store both keys immediately — Key 2 won't be shown again!
🔒 Security Warning: Treat your API keys like passwords. Never share them or commit them to public repositories.
🔑
Key 1
64-character public key
🔐
Key 2
64-character private key
🔄
Rotation
Regenerate keys anytime

🧪 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

  1. Select "Authenticate & Get Token" (/authorize endpoint)
  2. Enter your credentials:
    • Username: Your account username or email
    • Password: Your account password
  3. Click "Send API Request"
  4. Copy the access_token and account_id from 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
✅ Tip: The generated code includes your 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
💡 Tip: Always check the _status field in the JSON response. If it's "error", read the response field for details.

✅ 8. Best Practices

Security Always use HTTPS

All requests must use HTTPS. Your credentials and tokens are sensitive data.

Performance Reuse access tokens

An access_token is valid for 1 hour. Store it and reuse it for multiple requests instead of generating a new token each time.

Reliability Handle errors gracefully

Always check the response status and _status field. Implement proper error handling in your application.

Limitation No chunked uploads yet

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

🔐 Authentication
curl -X POST https://rediafile.com/cloud/api/v2/authorize \
  -d "username=your_username" \
  -d "password=your_password"
📤 Upload a File
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"
📥 Download a File
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"
📊 Check Account Limits
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.

Abrir Sandbox