curl --request GET \
--url https://stashy.example.com/v1/files \
--header 'Authorization: Bearer <token>'import requests
url = "https://stashy.example.com/v1/files"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://stashy.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://stashy.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",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://stashy.example.com/v1/files"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://stashy.example.com/v1/files")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://stashy.example.com/v1/files")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"id": "<string>",
"slug": "<string>",
"url": "<string>",
"name": "<string>",
"content_type": "<string>",
"size": "<string>",
"checksum": "<string>",
"visibility": "private",
"created_at": "2023-01-15T01:30:15.01Z",
"updated_at": "2023-01-15T01:30:15.01Z"
}
]List Files
List your files, newest first. To get the next page, pass the last file’s ID as after. A page shorter than limit is the last one.
curl --request GET \
--url https://stashy.example.com/v1/files \
--header 'Authorization: Bearer <token>'import requests
url = "https://stashy.example.com/v1/files"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://stashy.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://stashy.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",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://stashy.example.com/v1/files"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://stashy.example.com/v1/files")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://stashy.example.com/v1/files")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"id": "<string>",
"slug": "<string>",
"url": "<string>",
"name": "<string>",
"content_type": "<string>",
"size": "<string>",
"checksum": "<string>",
"visibility": "private",
"created_at": "2023-01-15T01:30:15.01Z",
"updated_at": "2023-01-15T01:30:15.01Z"
}
]Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Maximum number of files to return. Absent means 50.
1 <= x <= 100ID of the last file from the previous page. Absent means the first page.
^[A-Za-z0-9_-]{21}$Response
Success
Unique file ID.
^[A-Za-z0-9_-]{21}$Human-readable name at the end of the URL. Empty when not set.
128^[A-Za-z0-9._~-]*$Canonical URL of the file, including the slug when set.
Original filename, e.g. "Quarterly report.pdf". Empty when not set.
255^[^/\x00-\x1F\x7F]*$Media type of the content, from the Content-Type of the upload.
Size of the content in bytes.
CRC32C checksum of the content.
^([A-Za-z0-9+/]{6}==)?$Who can open the file by its URL: "private" (only the owner), "internal" (any signed-in user), or "public" (anyone).
private, internal, public A point in time in RFC 3339 format, with up to nanosecond precision. Output uses UTC (Z); input may use an offset from UTC.
"2023-01-15T01:30:15.01Z"
A point in time in RFC 3339 format, with up to nanosecond precision. Output uses UTC (Z); input may use an offset from UTC.
"2023-01-15T01:30:15.01Z"