Get Object
curl --request GET \
--url https://api.example.com/object/{track_id}import requests
url = "https://api.example.com/object/{track_id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/object/{track_id}', 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/object/{track_id}",
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/object/{track_id}"
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/object/{track_id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/object/{track_id}")
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_bodyObjects
Get Object
Fetch an object’s decoded bytes by its track address.
GET
/
object
/
{track_id}
Get Object
curl --request GET \
--url https://api.example.com/object/{track_id}import requests
url = "https://api.example.com/object/{track_id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/object/{track_id}', 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/object/{track_id}",
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/object/{track_id}"
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/object/{track_id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/object/{track_id}")
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_bodyFetches an object’s decoded bytes. This is the primary content endpoint: give it a track address, get the payload back.
The gateway does the assembly for you. If the object was uploaded as a stream, the gateway follows the manifest transparently and you receive the complete payload.
The caching headers are safe to take literally: this URL is track-addressed, so it can only ever serve one payload. That’s what makes Tapedrive content a good fit for CDNs and edge caches (serving through a CDN).
Looking up an object by name instead of track address? Name resolution goes through list objects.
Range requests
The endpoint honorsRange headers and answers with 206 Partial Content and a Content-Range header (Accept-Ranges is advertised). For streamed objects, a range request resolves the manifest and fetches only the segment tracks your range touches, which is what keeps range reads over large files cheap (how streams are laid out).
Response headers
| Header | Value |
|---|---|
Content-Type | from the object’s metadata |
Content-Length | the payload size |
ETag | the track’s on-chain commitment |
Cache-Control | public, max-age=31536000, immutable |
Errors
One case is specific to this endpoint:400 when the track exists but isn’t certified yet: the network hasn’t proven the data is available, so the gateway won’t serve it. Everything else follows the shared error conventions, and the endpoint is metered per IP (rate limits).
Example
Set$TAPE_GATEWAY using the gateway API setup, then replace the
example track address with the one returned by your upload:
curl -i "$TAPE_GATEWAY/object/7f3kD9mQxYz2pW8vN4cRtE5uH6bJamd9GvKq2rTeUWXs"
Response
HTTP/2 200
content-type: image/jpeg
content-length: 87342
etag: "HxbTgzim3nRPhWSyBEUvvteNRWLbrAxV3rDJyoW4mZ5J"
cache-control: public, max-age=31536000, immutable
accept-ranges: bytes