curl --request GET \
--url https://api.gwenlake.com/v1/connections/{connection_id}/files/content \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.gwenlake.com/v1/connections/{connection_id}/files/content"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.gwenlake.com/v1/connections/{connection_id}/files/content', 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.gwenlake.com/v1/connections/{connection_id}/files/content",
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://api.gwenlake.com/v1/connections/{connection_id}/files/content"
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://api.gwenlake.com/v1/connections/{connection_id}/files/content")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gwenlake.com/v1/connections/{connection_id}/files/content")
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{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Read a connection's file
One file’s bytes (Connection(...).filesystem().open(path)). Read-only:
a connection is a source, never a destination — a transform writes into
its output dataset.
Streamed from connection-service as it arrives, so the pod holds a chunk at
a time whatever the file’s size. A source that fails part-way can only cut
the body short — the status is sent — and the client sees a truncated
transfer rather than a short file: a 200 is chunked, with no length, and a
206 declares its Content-Length.
Part of the file with a standard Range header holding one range of
bytes (parse_range): connection-service seeks where the connector can
(download_range: smb, s3, gcs, azureblob) and the answer is a 206 with
Content-Range, Content-Length and Accept-Ranges relayed — how a
reader that needs the head of a 6.5 GB clip and the index at its end moves
a few MB of it. A connector that cannot seek ignores the range and sends
the whole file as a 200 (Accept-Ranges: none); the caller tells by the
status. A range that starts at or past the end is a 416 whose
Content-Range: bytes */size gives the size. A header this relay does not
take — another unit, several ranges, a malformed one — is ignored, as RFC
9110 allows: the whole file, a 200. bytes=-0 is a 416 with no size, no
source being asked.
curl --request GET \
--url https://api.gwenlake.com/v1/connections/{connection_id}/files/content \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.gwenlake.com/v1/connections/{connection_id}/files/content"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.gwenlake.com/v1/connections/{connection_id}/files/content', 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.gwenlake.com/v1/connections/{connection_id}/files/content",
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://api.gwenlake.com/v1/connections/{connection_id}/files/content"
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://api.gwenlake.com/v1/connections/{connection_id}/files/content")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gwenlake.com/v1/connections/{connection_id}/files/content")
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{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Your Gwenlake API key, sent as Authorization: Bearer <key>.
Headers
One byte range — bytes=0-1023, bytes=1024- or bytes=-512 — to read part of the file (206). Any other value is ignored and the whole file is sent (200).
Path Parameters
Query Parameters
The file's path, as listed.
Response
Successful Response