List Files
curl --request GET \
--url https://api.example.com/v1/filesimport requests
url = "https://api.example.com/v1/files"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/v1/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/v1/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/v1/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/v1/files")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/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{
"files": [
{}
],
"has_more": true,
"cursor": "<string>"
}Files
List Files
List all files in your account.
GET
/
v1
/
files
List Files
curl --request GET \
--url https://api.example.com/v1/filesimport requests
url = "https://api.example.com/v1/files"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/v1/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/v1/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/v1/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/v1/files")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/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{
"files": [
{}
],
"has_more": true,
"cursor": "<string>"
}List all files in your account with optional filtering and pagination.
Query Parameters
Response
Example
curl https://api.stashfyle.com/v1/files \
-H "Authorization: Bearer sk_live_xxx"
const response = await fetch('https://api.stashfyle.com/v1/files', {
headers: { 'Authorization': 'Bearer sk_live_xxx' }
});
const { files, has_more, cursor } = await response.json();
response = requests.get(
'https://api.stashfyle.com/v1/files',
headers={'Authorization': 'Bearer sk_live_xxx'}
)
data = response.json()
files = data['files']
Response
{
"files": [
{
"id": "f_abc123xyz",
"url": "https://cdn.stashfyle.com/live/user_123/f_abc123xyz/photo.jpg",
"name": "photo.jpg",
"folder": null,
"size": 248000,
"type": "image/jpeg",
"private": false,
"expires_at": null,
"created_at": "2024-01-15T10:30:00Z"
}
],
"has_more": true,
"cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0wMS0xNVQxMDozMDowMFoifQ"
}
Filtering by Folder
curl "https://api.stashfyle.com/v1/files?folder=images/avatars" \
-H "Authorization: Bearer sk_live_xxx"
Pagination
# First page
curl "https://api.stashfyle.com/v1/files?limit=20" \
-H "Authorization: Bearer sk_live_xxx"
# Next page using cursor from previous response
curl "https://api.stashfyle.com/v1/files?limit=20&cursor=eyJ..." \
-H "Authorization: Bearer sk_live_xxx"