curl --request GET \
--url https://sailbox-api.sailresearch.com/v1/sailboxes/{sailbox_id}/files/downloadimport requests
url = "https://sailbox-api.sailresearch.com/v1/sailboxes/{sailbox_id}/files/download"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://sailbox-api.sailresearch.com/v1/sailboxes/{sailbox_id}/files/download', 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://sailbox-api.sailresearch.com/v1/sailboxes/{sailbox_id}/files/download",
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://sailbox-api.sailresearch.com/v1/sailboxes/{sailbox_id}/files/download"
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://sailbox-api.sailresearch.com/v1/sailboxes/{sailbox_id}/files/download")
.asString();require 'uri'
require 'net/http'
url = URI("https://sailbox-api.sailresearch.com/v1/sailboxes/{sailbox_id}/files/download")
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"<string>""<string>"{
"error": {
"message": "memory_limit_gib for size m must be between 8 and 128",
"type": "invalid_request_error",
"param": null,
"code": null
}
}{
"error": {
"message": "download URL has expired",
"type": "permission_error",
"param": null,
"code": null
}
}{
"error": {
"message": "read sailbox file: open /workspace/render.png: no such file or directory",
"type": "not_found_error",
"param": null,
"code": null
}
}{
"error": {
"message": "sailbox \"sb_9c8f1e2a-3b4d-4f5a-8c7e-1d2f3a4b5c6d\" is paused. call resume() first",
"type": "conflict_error",
"param": null,
"code": null
}
}{
"error": {
"message": "Authentication service unavailable",
"type": "server_error",
"param": null,
"code": null
}
}{
"error": {
"message": "idempotent request still in flight",
"type": "server_error",
"param": null,
"code": null
}
}Fetch a file through its download URL
Streams the file a download URL names. Use the URL exactly as minted; its query is signed. The response supports byte ranges, If-Range, and the If-None-Match and If-Modified-Since validators. A fetch wakes a sleeping Sailbox before the first byte.
curl --request GET \
--url https://sailbox-api.sailresearch.com/v1/sailboxes/{sailbox_id}/files/downloadimport requests
url = "https://sailbox-api.sailresearch.com/v1/sailboxes/{sailbox_id}/files/download"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://sailbox-api.sailresearch.com/v1/sailboxes/{sailbox_id}/files/download', 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://sailbox-api.sailresearch.com/v1/sailboxes/{sailbox_id}/files/download",
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://sailbox-api.sailresearch.com/v1/sailboxes/{sailbox_id}/files/download"
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://sailbox-api.sailresearch.com/v1/sailboxes/{sailbox_id}/files/download")
.asString();require 'uri'
require 'net/http'
url = URI("https://sailbox-api.sailresearch.com/v1/sailboxes/{sailbox_id}/files/download")
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"<string>""<string>"{
"error": {
"message": "memory_limit_gib for size m must be between 8 and 128",
"type": "invalid_request_error",
"param": null,
"code": null
}
}{
"error": {
"message": "download URL has expired",
"type": "permission_error",
"param": null,
"code": null
}
}{
"error": {
"message": "read sailbox file: open /workspace/render.png: no such file or directory",
"type": "not_found_error",
"param": null,
"code": null
}
}{
"error": {
"message": "sailbox \"sb_9c8f1e2a-3b4d-4f5a-8c7e-1d2f3a4b5c6d\" is paused. call resume() first",
"type": "conflict_error",
"param": null,
"code": null
}
}{
"error": {
"message": "Authentication service unavailable",
"type": "server_error",
"param": null,
"code": null
}
}{
"error": {
"message": "idempotent request still in flight",
"type": "server_error",
"param": null,
"code": null
}
}Path Parameters
Id of the Sailbox, as returned by create. It is sb_ followed by a UUID.
Query Parameters
The file the URL was minted for.
When the URL stops working, as a Unix timestamp in seconds.
Signature over the other parameters. Editing any of them invalidates it.
Present when the URL was minted with attachment.
attachment Present when the URL was minted with immutable.
immutable Response
The whole file. Content-Type comes from the file's extension, Content-Length is its size, ETag and Last-Modified are its validators, and Accept-Ranges: bytes is set.
The response is of type file.