List Files
curl --request GET \
--url https://api.example.com/filesimport requests
url = "https://api.example.com/files"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/files', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/files",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/files"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/files")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/files")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"success": false,
"error": {
"code": "not_found",
"message": "Folder not found"
}
}
{
"success": false,
"error": {
"code": "authentication_failed",
"message": "Invalid API key"
}
}
{
"success": false,
"error": {
"code": "rate_limit_exceeded",
"message": "Too many requests. Try again in 60 seconds."
}
}
Endpoints
List Files
Retrieve a list of files from your Hubsy Cloud account
GET
/
files
List Files
curl --request GET \
--url https://api.example.com/filesimport requests
url = "https://api.example.com/files"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/files', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/files",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/files"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/files")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/files")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"success": false,
"error": {
"code": "not_found",
"message": "Folder not found"
}
}
{
"success": false,
"error": {
"code": "authentication_failed",
"message": "Invalid API key"
}
}
{
"success": false,
"error": {
"code": "rate_limit_exceeded",
"message": "Too many requests. Try again in 60 seconds."
}
}
Overview
Retrieve a paginated list of files in your account or within a specific folder.Query Parameters
string
Filter files by folder ID. Omit to list files in root directory.
integer
default:"1"
Page number for pagination
integer
default:"50"
Number of items per page (max: 100)
string
default:"created_desc"
Sort order. Options:
created_asc, created_desc, modified_asc, modified_desc, name_asc, name_desc, size_asc, size_descstring
Filter by file type:
image, video, audio, document, archive, otherstring
Search files by name
Example Request
curl https://api.hubsy.cloud/v1/files?folder_id=folder_123&per_page=10 \
-H "Authorization: Bearer YOUR_API_KEY"
const response = await fetch('https://api.hubsy.cloud/v1/files?folder_id=folder_123&per_page=10', {
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
});
const data = await response.json();
console.log(data.data);
import requests
response = requests.get(
'https://api.hubsy.cloud/v1/files',
params={'folder_id': 'folder_123', 'per_page': 10},
headers={'Authorization': 'Bearer YOUR_API_KEY'}
)
files = response.json()['data']
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.hubsy.cloud/v1/files?folder_id=folder_123&per_page=10');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer YOUR_API_KEY'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$data = json_decode($response, true);
Response
boolean
Indicates if the request was successful
array
Array of file objects
Show File Object
Show File Object
string
Unique file identifier
string
File name with extension
integer
File size in bytes
string
MIME type (e.g., “image/jpeg”, “application/pdf”)
string
File category:
image, video, audio, document, archive, otherstring
ID of parent folder, or
null if in rootstring
ISO 8601 timestamp of when file was uploaded
string
ISO 8601 timestamp of last modification
string
URL to file thumbnail (if available)
string
Direct download URL (expires in 1 hour)
boolean
Whether file has active share links
object
Example Response
{
"success": true,
"data": [
{
"id": "file_abc123",
"name": "presentation.pdf",
"size": 2458624,
"type": "application/pdf",
"category": "document",
"folder_id": "folder_123",
"created_at": "2024-01-15T10:30:00Z",
"modified_at": "2024-01-15T10:30:00Z",
"thumbnail_url": "https://cdn.hubsy.cloud/thumbs/file_abc123.jpg",
"download_url": "https://cdn.hubsy.cloud/download/file_abc123?token=xyz",
"is_shared": true
},
{
"id": "file_def456",
"name": "photo.jpg",
"size": 1024000,
"type": "image/jpeg",
"category": "image",
"folder_id": "folder_123",
"created_at": "2024-01-14T15:20:00Z",
"modified_at": "2024-01-14T15:20:00Z",
"thumbnail_url": "https://cdn.hubsy.cloud/thumbs/file_def456.jpg",
"download_url": "https://cdn.hubsy.cloud/download/file_def456?token=abc",
"is_shared": false
}
],
"pagination": {
"page": 1,
"per_page": 10,
"total_items": 42,
"total_pages": 5
}
}
Error Responses
{
"success": false,
"error": {
"code": "not_found",
"message": "Folder not found"
}
}
{
"success": false,
"error": {
"code": "authentication_failed",
"message": "Invalid API key"
}
}
{
"success": false,
"error": {
"code": "rate_limit_exceeded",
"message": "Too many requests. Try again in 60 seconds."
}
}
Notes
- The
download_urlexpires after 1 hour. Generate a new one by calling this endpoint again. - Thumbnails are only available for images, videos, and PDFs
- Deleted files are not included in the list
- Maximum
per_pagevalue is 100