Download a file
Download a file that a flow or a grid produced, from the URL its response gave.
GET
/
v1
/
files
/
download
cURL
curl -L "https://api.qxlabs.com/v1/files/download?key=5f2b8c1d9e3a4b7c8d6e0f1a2b3c4d5e%2Ffiles%2F0c9e2f7a41b84d3e9a6f5b1c8d2e7f30%2Fbig-orders.csv" \
-H "Authorization: Bearer <YOUR_QX_API_KEY>" \
-o big-orders.csvimport requests
headers = {"Authorization": "Bearer <YOUR_QX_API_KEY>"}
execution = requests.get(
"https://api.qxlabs.com/v1/flows/c71a5f0e1d2b4a7e9a513f6f0d2b8e10/executions/9b2e4d713a5c4f8bb6e21c7d9a0f3e58",
headers=headers,
).json()
# Save every file the flow's nodes output
for node in execution["nodes"]:
for value in node["output"].values():
if isinstance(value, dict) and value.get("type") == "file":
content = requests.get(value["url"], headers=headers).content
with open(value["name"], "wb") as f:
f.write(content)
import { writeFile } from "node:fs/promises";
const headers = { Authorization: "Bearer <YOUR_QX_API_KEY>" };
const execution = await (
await fetch(
"https://api.qxlabs.com/v1/flows/c71a5f0e1d2b4a7e9a513f6f0d2b8e10/executions/9b2e4d713a5c4f8bb6e21c7d9a0f3e58",
{ headers },
)
).json();
// Save every file the flow's nodes output
for (const node of execution.nodes) {
for (const value of Object.values<any>(node.output)) {
if (value?.type === "file") {
const file = await fetch(value.url, { headers });
await writeFile(value.name, Buffer.from(await file.arrayBuffer()));
}
}
}
"<string>"{
"error": "key is required"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "Read rate limit exceeded for flows endpoints"
}Query Parameters
Response
The file, with Content-Disposition carrying its name
The response is of type file.
⌘I
cURL
curl -L "https://api.qxlabs.com/v1/files/download?key=5f2b8c1d9e3a4b7c8d6e0f1a2b3c4d5e%2Ffiles%2F0c9e2f7a41b84d3e9a6f5b1c8d2e7f30%2Fbig-orders.csv" \
-H "Authorization: Bearer <YOUR_QX_API_KEY>" \
-o big-orders.csvimport requests
headers = {"Authorization": "Bearer <YOUR_QX_API_KEY>"}
execution = requests.get(
"https://api.qxlabs.com/v1/flows/c71a5f0e1d2b4a7e9a513f6f0d2b8e10/executions/9b2e4d713a5c4f8bb6e21c7d9a0f3e58",
headers=headers,
).json()
# Save every file the flow's nodes output
for node in execution["nodes"]:
for value in node["output"].values():
if isinstance(value, dict) and value.get("type") == "file":
content = requests.get(value["url"], headers=headers).content
with open(value["name"], "wb") as f:
f.write(content)
import { writeFile } from "node:fs/promises";
const headers = { Authorization: "Bearer <YOUR_QX_API_KEY>" };
const execution = await (
await fetch(
"https://api.qxlabs.com/v1/flows/c71a5f0e1d2b4a7e9a513f6f0d2b8e10/executions/9b2e4d713a5c4f8bb6e21c7d9a0f3e58",
{ headers },
)
).json();
// Save every file the flow's nodes output
for (const node of execution.nodes) {
for (const value of Object.values<any>(node.output)) {
if (value?.type === "file") {
const file = await fetch(value.url, { headers });
await writeFile(value.name, Buffer.from(await file.arrayBuffer()));
}
}
}
"<string>"{
"error": "key is required"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "Read rate limit exceeded for flows endpoints"
}