Démarrage rapide
Obtenez un jeton
Appelez /authorize avec vos identifiants ou clés API pour obtenir un Bearer token.
Incluez le jeton
Ajoutez Authorization: Bearer <token> à chaque requête authentifiée.
Faites des appels
Téléversez, téléchargez et gérez vos fichiers et dossiers via l’API REST.
Authentification
Autoriser
Obtenir un jeton d'accès Bearer avec les identifiants du compte ou les clés API.
Les jetons expirent après 24 heures. Stockez-les de manière sécurisée.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| username | string | optional Yes (if not using API keys) | Nom d'utilisateur du compte admin |
| password | string | optional Yes (if not using API keys) | Mot de passe du compte secret123 |
| api_key | string | optional Yes (if not using username/password) | Clé API publique pk_live_xxxxxxxx |
| api_secret | string | optional Yes (if not using username/password) | Clé API secrète sk_live_xxxxxxxx |
curl -X POST https://rediafile.com/cloud/api/v2/authorize \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "username=admin" \
-d "password=secret123"<?php
$ch = curl_init('https://rediafile.com/cloud/api/v2/authorize');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, [
'username' => 'admin',
'password' => 'secret123',
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);import requests
resp = requests.post('https://rediafile.com/cloud/api/v2/authorize', data={
'username': 'admin',
'password': 'secret123',
})
print(resp.json())const res = await fetch('https://rediafile.com/cloud/api/v2/authorize', {
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: new URLSearchParams({ username: 'admin', password: 'secret123' }),
});
const data = await res.json();Sample response
{
"status": "success",
"data": {
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxNTg2NDIiLCJpYXQiOjE3MjQ3MjY0MDB9.signature",
"token_type": "Bearer",
"expires_in": 86400,
"account_id": "158642"
}
}Désactiver le jeton d'accès
Révoquer et invalider un jeton d'accès précédemment émis.
Requiert Authorization: Bearer <token>
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| access_token | string | required Yes | Le jeton à révoquer eyJhbGciOi... |
curl -X POST https://rediafile.com/cloud/api/v2/disable_access_token \
-H "Authorization: Bearer $TOKEN" \
-d "access_token=eyJhbGciOi..."<?php
$ch = curl_init('https://rediafile.com/cloud/api/v2/disable_access_token');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer ' . $token]);
curl_setopt($ch, CURLOPT_POSTFIELDS, ['access_token' => $token]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);import requests
resp = requests.post('https://rediafile.com/cloud/api/v2/disable_access_token',
headers={'Authorization': f'Bearer {token}'},
data={'access_token': token},
)await fetch('https://rediafile.com/cloud/api/v2/disable_access_token', {
method: 'POST',
headers: { 'Authorization': `Bearer ${token}` },
body: new URLSearchParams({ access_token: token }),
});Sample response
{
"status": "success",
"data": {
"revoked": true,
"message": "Token has been disabled."
}
}Endpoints Compte
Infos du compte
Récupérer les informations détaillées du compte authentifié.
Requiert Authorization: Bearer <token>
curl https://rediafile.com/cloud/api/v2/account/info \
-H "Authorization: Bearer $TOKEN"<?php
$ch = curl_init('https://rediafile.com/cloud/api/v2/account/info');
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer ' . $token]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);import requests
resp = requests.get('https://rediafile.com/cloud/api/v2/account/info',
headers={'Authorization': f'Bearer {token}'},
)const res = await fetch('https://rediafile.com/cloud/api/v2/account/info', {
headers: { 'Authorization': `Bearer ${token}` },
});
const data = await res.json();Sample response
{
"status": "success",
"data": {
"account_id": "158642",
"username": "admin",
"email": "admin@example.com",
"storage_used": "456.7 GB",
"storage_limit": "1024 GB",
"plan": "Business",
"created_at": "2023-01-15T10:30:00Z"
}
}Forfait du compte
Récupérer le forfait d'abonnement actuel et les détails du quota.
Requiert Authorization: Bearer <token>
curl https://rediafile.com/cloud/api/v2/account/package \
-H "Authorization: Bearer $TOKEN"<?php
$ch = curl_init('https://rediafile.com/cloud/api/v2/account/package');
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer ' . $token]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);import requests
resp = requests.get('https://rediafile.com/cloud/api/v2/account/package',
headers={'Authorization': f'Bearer {token}'},
)const res = await fetch('https://rediafile.com/cloud/api/v2/account/package', {
headers: { 'Authorization': `Bearer ${token}` },
});
const data = await res.json();Sample response
{
"status": "success",
"data": {
"package": "Business",
"max_file_size": "10240 MB",
"max_storage": "1024 GB",
"bandwidth_limit": "unlimited",
"features": [
"password_folders",
"temporary_links",
"api_access"
]
}
}Endpoints Fichiers
Téléverser un fichier
Téléverser un fichier (jusqu'à 10 Go) via multipart/form-data. Retourne une URL courte.
Requiert Authorization: Bearer <token>. Utilisez multipart/form-data.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| file | file | required Yes | Le fichier à téléverser (multipart) (binary) |
| folder_id | string | optional No | ID du dossier cible fld_123 |
curl -X POST https://rediafile.com/cloud/api/v2/file/upload \
-H "Authorization: Bearer $TOKEN" \
-F "file=@document.pdf"<?php
$ch = curl_init('https://rediafile.com/cloud/api/v2/file/upload');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer ' . $token]);
curl_setopt($ch, CURLOPT_POSTFIELDS, [
'file' => new CURLFile('/path/to/document.pdf'),
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);import requests
with open('document.pdf', 'rb') as f:
resp = requests.post('https://rediafile.com/cloud/api/v2/file/upload',
headers={'Authorization': f'Bearer {token}'},
files={'file': f},
)const form = new FormData();
form.append('file', fileInput.files[0]);
const res = await fetch('https://rediafile.com/cloud/api/v2/file/upload', {
method: 'POST',
headers: { 'Authorization': `Bearer ${token}` },
body: form,
});Sample response
{
"status": "success",
"data": [
{
"name": "document.pdf",
"short_url": "2Vv",
"url": "https://rediafile.com/2Vv",
"size": "4.5 MB",
"file_id": "file_84729",
"created_at": "2024-08-26T12:00:00Z"
}
]
}Télécharger un fichier
Obtenir une URL de téléchargement temporaire signée via son URL courte.
Requiert Authorization: Bearer <token>
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| short_url | string | required Yes | Code URL courte du fichier 2Vv |
curl "https://rediafile.com/cloud/api/v2/file/download?short_url=2Vv" \
-H "Authorization: Bearer $TOKEN"<?php
$ch = curl_init('https://rediafile.com/cloud/api/v2/file/download?short_url=2Vv');
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer ' . $token]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);import requests
resp = requests.get('https://rediafile.com/cloud/api/v2/file/download',
headers={'Authorization': f'Bearer {token}'},
params={'short_url': '2Vv'},
)const res = await fetch('https://rediafile.com/cloud/api/v2/file/download?short_url=2Vv', {
headers: { 'Authorization': `Bearer ${token}` },
});
const data = await res.json();Sample response
{
"status": "success",
"data": {
"download_url": "https://rediafile.com/2Vv?download_token=abc123def456",
"expires_at": "2024-08-26T13:00:00Z"
}
}Téléversement URL distante
Mettre en file un téléversement depuis une URL distante (récupération serveur-à-serveur).
Requiert Authorization: Bearer <token>
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| url | string | required Yes | URL distante à récupérer https://example.com/large-file.zip |
curl -X POST https://rediafile.com/cloud/api/v2/file/url_upload_add \
-H "Authorization: Bearer $TOKEN" \
-d "url=https://example.com/large-file.zip"<?php
$ch = curl_init('https://rediafile.com/cloud/api/v2/file/url_upload_add');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer ' . $token]);
curl_setopt($ch, CURLOPT_POSTFIELDS, ['url' => 'https://example.com/large-file.zip']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);import requests
resp = requests.post('https://rediafile.com/cloud/api/v2/file/url_upload_add',
headers={'Authorization': f'Bearer {token}'},
data={'url': 'https://example.com/large-file.zip'},
)const res = await fetch('https://rediafile.com/cloud/api/v2/file/url_upload_add', {
method: 'POST',
headers: { 'Authorization': `Bearer ${token}` },
body: new URLSearchParams({ url: 'https://example.com/large-file.zip' }),
});Sample response
{
"status": "success",
"data": {
"task_id": "task_4821",
"status": "queued",
"message": "URL upload added to queue."
}
}Statut téléversement URL
Vérifier la progression d'une tâche de téléversement URL distante.
Requiert Authorization: Bearer <token>
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| task_id | string | required Yes | ID de tâche de url_upload_add task_4821 |
curl "https://rediafile.com/cloud/api/v2/file/url_upload_status?task_id=task_4821" \
-H "Authorization: Bearer $TOKEN"<?php
$ch = curl_init('https://rediafile.com/cloud/api/v2/file/url_upload_status?task_id=task_4821');
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer ' . $token]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);import requests
resp = requests.get('https://rediafile.com/cloud/api/v2/file/url_upload_status',
headers={'Authorization': f'Bearer {token}'},
params={'task_id': 'task_4821'},
)const res = await fetch('https://rediafile.com/cloud/api/v2/file/url_upload_status?task_id=task_4821', {
headers: { 'Authorization': `Bearer ${token}` },
});Sample response
{
"status": "success",
"data": {
"task_id": "task_4821",
"status": "completed",
"progress": 100,
"file_id": "file_84730",
"short_url": "9Xk"
}
}Infos fichier
Récupérer les métadonnées d'un fichier spécifique.
Requiert Authorization: Bearer <token>
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| file_id | string | required Yes | ID du fichier file_84729 |
curl "https://rediafile.com/cloud/api/v2/file/info?file_id=file_84729" \
-H "Authorization: Bearer $TOKEN"<?php
$ch = curl_init('https://rediafile.com/cloud/api/v2/file/info?file_id=file_84729');
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer ' . $token]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);import requests
resp = requests.get('https://rediafile.com/cloud/api/v2/file/info',
headers={'Authorization': f'Bearer {token}'},
params={'file_id': 'file_84729'},
)const res = await fetch('https://rediafile.com/cloud/api/v2/file/info?file_id=file_84729', {
headers: { 'Authorization': `Bearer ${token}` },
});Sample response
{
"status": "success",
"data": {
"file_id": "file_84729",
"name": "document.pdf",
"size": "4.5 MB",
"type": "application/pdf",
"short_url": "2Vv",
"folder_id": "fld_root",
"created_at": "2024-08-26T12:00:00Z"
}
}Modifier fichier
Mettre à jour les métadonnées du fichier (nom, mot de passe, expiration).
Requiert Authorization: Bearer <token>
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| file_id | string | required Yes | ID du fichier file_84729 |
| name | string | optional No | Nouveau nom de fichier renamed.pdf |
| password | string | optional No | Protéger le fichier par mot de passe mypass |
curl -X POST https://rediafile.com/cloud/api/v2/file/edit \
-H "Authorization: Bearer $TOKEN" \
-d "file_id=file_84729" \
-d "name=renamed.pdf"<?php
$ch = curl_init('https://rediafile.com/cloud/api/v2/file/edit');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer ' . $token]);
curl_setopt($ch, CURLOPT_POSTFIELDS, ['file_id' => 'file_84729', 'name' => 'renamed.pdf']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);import requests
resp = requests.post('https://rediafile.com/cloud/api/v2/file/edit',
headers={'Authorization': f'Bearer {token}'},
data={'file_id': 'file_84729', 'name': 'renamed.pdf'},
)await fetch('https://rediafile.com/cloud/api/v2/file/edit', {
method: 'POST',
headers: { 'Authorization': `Bearer ${token}` },
body: new URLSearchParams({ file_id: 'file_84729', name: 'renamed.pdf' }),
});Sample response
{
"status": "success",
"data": {
"file_id": "file_84729",
"updated": true,
"message": "File updated."
}
}Supprimer fichier
Supprimer définitivement un fichier.
Requiert Authorization: Bearer <token>
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| file_id | string | required Yes | ID du fichier à supprimer file_84729 |
curl -X POST https://rediafile.com/cloud/api/v2/file/delete \
-H "Authorization: Bearer $TOKEN" \
-d "file_id=file_84729"<?php
$ch = curl_init('https://rediafile.com/cloud/api/v2/file/delete');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer ' . $token]);
curl_setopt($ch, CURLOPT_POSTFIELDS, ['file_id' => 'file_84729']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);import requests
resp = requests.post('https://rediafile.com/cloud/api/v2/file/delete',
headers={'Authorization': f'Bearer {token}'},
data={'file_id': 'file_84729'},
)await fetch('https://rediafile.com/cloud/api/v2/file/delete', {
method: 'POST',
headers: { 'Authorization': `Bearer ${token}` },
body: new URLSearchParams({ file_id: 'file_84729' }),
});Sample response
{
"status": "success",
"data": {
"file_id": "file_84729",
"deleted": true
}
}Déplacer fichier
Déplacer un fichier vers un autre dossier.
Requiert Authorization: Bearer <token>
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| file_id | string | required Yes | ID du fichier file_84729 |
| folder_id | string | required Yes | ID du dossier de destination fld_123 |
curl -X POST https://rediafile.com/cloud/api/v2/file/move \
-H "Authorization: Bearer $TOKEN" \
-d "file_id=file_84729" \
-d "folder_id=fld_123"<?php
$ch = curl_init('https://rediafile.com/cloud/api/v2/file/move');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer ' . $token]);
curl_setopt($ch, CURLOPT_POSTFIELDS, ['file_id' => 'file_84729', 'folder_id' => 'fld_123']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);import requests
resp = requests.post('https://rediafile.com/cloud/api/v2/file/move',
headers={'Authorization': f'Bearer {token}'},
data={'file_id': 'file_84729', 'folder_id': 'fld_123'},
)await fetch('https://rediafile.com/cloud/api/v2/file/move', {
method: 'POST',
headers: { 'Authorization': `Bearer ${token}` },
body: new URLSearchParams({ file_id: 'file_84729', folder_id: 'fld_123' }),
});Sample response
{
"status": "success",
"data": {
"file_id": "file_84729",
"moved_to": "fld_123"
}
}Copier fichier
Créer une copie d'un fichier dans un dossier spécifié.
Requiert Authorization: Bearer <token>
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| file_id | string | required Yes | ID du fichier file_84729 |
| folder_id | string | required Yes | ID du dossier de destination fld_456 |
curl -X POST https://rediafile.com/cloud/api/v2/file/copy \
-H "Authorization: Bearer $TOKEN" \
-d "file_id=file_84729" \
-d "folder_id=fld_456"<?php
$ch = curl_init('https://rediafile.com/cloud/api/v2/file/copy');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer ' . $token]);
curl_setopt($ch, CURLOPT_POSTFIELDS, ['file_id' => 'file_84729', 'folder_id' => 'fld_456']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);import requests
resp = requests.post('https://rediafile.com/cloud/api/v2/file/copy',
headers={'Authorization': f'Bearer {token}'},
data={'file_id': 'file_84729', 'folder_id': 'fld_456'},
)await fetch('https://rediafile.com/cloud/api/v2/file/copy', {
method: 'POST',
headers: { 'Authorization': `Bearer ${token}` },
body: new URLSearchParams({ file_id: 'file_84729', folder_id: 'fld_456' }),
});Sample response
{
"status": "success",
"data": {
"original_id": "file_84729",
"copy_id": "file_84730",
"copied_to": "fld_456"
}
}Endpoints Dossiers
Créer un dossier
Créer un nouveau dossier, éventuellement protégé par mot de passe.
Requiert Authorization: Bearer <token>
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| folder_name | string | required Yes | Nom du nouveau dossier My New Folder |
| parent_id | string | optional No | ID du dossier parent (pour l'imbrication) fld_root |
| password | string | optional No | Mot de passe pour protéger le dossier secret |
curl -X POST https://rediafile.com/cloud/api/v2/folder/create \
-H "Authorization: Bearer $TOKEN" \
-d "folder_name=My New Folder"<?php
$ch = curl_init('https://rediafile.com/cloud/api/v2/folder/create');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer ' . $token]);
curl_setopt($ch, CURLOPT_POSTFIELDS, ['folder_name' => 'My New Folder']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);import requests
resp = requests.post('https://rediafile.com/cloud/api/v2/folder/create',
headers={'Authorization': f'Bearer {token}'},
data={'folder_name': 'My New Folder'},
)await fetch('https://rediafile.com/cloud/api/v2/folder/create', {
method: 'POST',
headers: { 'Authorization': `Bearer ${token}` },
body: new URLSearchParams({ folder_name: 'My New Folder' }),
});Sample response
{
"status": "success",
"data": {
"folder_id": "fld_482",
"folder_name": "My New Folder",
"created_at": "2024-08-26T12:00:00Z"
}
}Lister le dossier
Lister les fichiers et sous-dossiers dans un dossier.
Requiert Authorization: Bearer <token>
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| folder_id | string | optional No (defaults to root) | ID du dossier (racine si omis) fld_root |
curl "https://rediafile.com/cloud/api/v2/folder/listing?folder_id=fld_root" \
-H "Authorization: Bearer $TOKEN"<?php
$ch = curl_init('https://rediafile.com/cloud/api/v2/folder/listing?folder_id=fld_root');
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer ' . $token]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);import requests
resp = requests.get('https://rediafile.com/cloud/api/v2/folder/listing',
headers={'Authorization': f'Bearer {token}'},
params={'folder_id': 'fld_root'},
)const res = await fetch('https://rediafile.com/cloud/api/v2/folder/listing?folder_id=fld_root', {
headers: { 'Authorization': `Bearer ${token}` },
});
const data = await res.json();Sample response
{
"status": "success",
"data": {
"folder_id": "fld_root",
"folders": [
{
"folder_id": "fld_123",
"name": "Documents",
"file_count": 12
}
],
"files": [
{
"file_id": "file_84729",
"name": "document.pdf",
"short_url": "2Vv",
"size": "4.5 MB"
}
]
}
}Infos dossier
Récupérer les métadonnées d'un dossier spécifique.
Requiert Authorization: Bearer <token>
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| folder_id | string | required Yes | ID du dossier fld_123 |
curl "https://rediafile.com/cloud/api/v2/folder/info?folder_id=fld_123" \
-H "Authorization: Bearer $TOKEN"<?php
$ch = curl_init('https://rediafile.com/cloud/api/v2/folder/info?folder_id=fld_123');
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer ' . $token]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);import requests
resp = requests.get('https://rediafile.com/cloud/api/v2/folder/info',
headers={'Authorization': f'Bearer {token}'},
params={'folder_id': 'fld_123'},
)const res = await fetch('https://rediafile.com/cloud/api/v2/folder/info?folder_id=fld_123', {
headers: { 'Authorization': `Bearer ${token}` },
});Sample response
{
"status": "success",
"data": {
"folder_id": "fld_123",
"name": "Documents",
"parent_id": "fld_root",
"file_count": 12,
"folder_count": 2,
"protected": false,
"created_at": "2024-01-10T09:00:00Z"
}
}Modifier dossier
Mettre à jour les métadonnées du dossier (nom, mot de passe).
Requiert Authorization: Bearer <token>
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| folder_id | string | required Yes | ID du dossier fld_123 |
| folder_name | string | optional No | Nouveau nom du dossier Renamed Folder |
curl -X POST https://rediafile.com/cloud/api/v2/folder/edit \
-H "Authorization: Bearer $TOKEN" \
-d "folder_id=fld_123" \
-d "folder_name=Renamed Folder"<?php
$ch = curl_init('https://rediafile.com/cloud/api/v2/folder/edit');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer ' . $token]);
curl_setopt($ch, CURLOPT_POSTFIELDS, ['folder_id' => 'fld_123', 'folder_name' => 'Renamed Folder']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);import requests
resp = requests.post('https://rediafile.com/cloud/api/v2/folder/edit',
headers={'Authorization': f'Bearer {token}'},
data={'folder_id': 'fld_123', 'folder_name': 'Renamed Folder'},
)await fetch('https://rediafile.com/cloud/api/v2/folder/edit', {
method: 'POST',
headers: { 'Authorization': `Bearer ${token}` },
body: new URLSearchParams({ folder_id: 'fld_123', folder_name: 'Renamed Folder' }),
});Sample response
{
"status": "success",
"data": {
"folder_id": "fld_123",
"updated": true
}
}Supprimer dossier
Supprimer définitivement un dossier et tout son contenu.
Requiert Authorization: Bearer <token>
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| folder_id | string | required Yes | ID du dossier à supprimer fld_123 |
curl -X POST https://rediafile.com/cloud/api/v2/folder/delete \
-H "Authorization: Bearer $TOKEN" \
-d "folder_id=fld_123"<?php
$ch = curl_init('https://rediafile.com/cloud/api/v2/folder/delete');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer ' . $token]);
curl_setopt($ch, CURLOPT_POSTFIELDS, ['folder_id' => 'fld_123']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);import requests
resp = requests.post('https://rediafile.com/cloud/api/v2/folder/delete',
headers={'Authorization': f'Bearer {token}'},
data={'folder_id': 'fld_123'},
)await fetch('https://rediafile.com/cloud/api/v2/folder/delete', {
method: 'POST',
headers: { 'Authorization': `Bearer ${token}` },
body: new URLSearchParams({ folder_id: 'fld_123' }),
});Sample response
{
"status": "success",
"data": {
"folder_id": "fld_123",
"deleted": true
}
}Déplacer dossier
Déplacer un dossier vers un autre dossier parent.
Requiert Authorization: Bearer <token>
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| folder_id | string | required Yes | ID du dossier à déplacer fld_123 |
| parent_id | string | required Yes | ID du dossier parent de destination fld_456 |
curl -X POST https://rediafile.com/cloud/api/v2/folder/move \
-H "Authorization: Bearer $TOKEN" \
-d "folder_id=fld_123" \
-d "parent_id=fld_456"<?php
$ch = curl_init('https://rediafile.com/cloud/api/v2/folder/move');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer ' . $token]);
curl_setopt($ch, CURLOPT_POSTFIELDS, ['folder_id' => 'fld_123', 'parent_id' => 'fld_456']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);import requests
resp = requests.post('https://rediafile.com/cloud/api/v2/folder/move',
headers={'Authorization': f'Bearer {token}'},
data={'folder_id': 'fld_123', 'parent_id': 'fld_456'},
)await fetch('https://rediafile.com/cloud/api/v2/folder/move', {
method: 'POST',
headers: { 'Authorization': `Bearer ${token}` },
body: new URLSearchParams({ folder_id: 'fld_123', parent_id: 'fld_456' }),
});Sample response
{
"status": "success",
"data": {
"folder_id": "fld_123",
"moved_to": "fld_456"
}
}HTTP Errors
Bonnes pratiques
- Cachez les jetons côté serveur — ne les exposez jamais au navigateur.
- Utilisez le téléversement par URL pour les gros fichiers distants.
- Gérez le code 429 avec un backoff exponentiel.
- Régénérez les liens de partage temporaires plutôt que de réutiliser des jetons.
- Surveillez l’en-tête X-RateLimit-Remaining pour anticiper les limites.