Files
Download file
A link that downloads the file you uploaded, under its own name, valid 60 seconds.
GET
/
knowledge-base
/
files
/
{fileId}
/
download
Download file
curl --request GET \
--url https://api.verbeo.ai/v1/knowledge-base/files/{fileId}/download \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.verbeo.ai/v1/knowledge-base/files/{fileId}/download"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.verbeo.ai/v1/knowledge-base/files/{fileId}/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://api.verbeo.ai/v1/knowledge-base/files/{fileId}/download",
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.verbeo.ai/v1/knowledge-base/files/{fileId}/download"
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.verbeo.ai/v1/knowledge-base/files/{fileId}/download")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.verbeo.ai/v1/knowledge-base/files/{fileId}/download")
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_bodyReturns a link that downloads the file you uploaded, byte for byte, under its own name. The link works for 60 seconds: fetch it at once. It needs no API key.
Path parameters
Request
URL=$(curl -s "https://api.verbeo.ai/v1/knowledge-base/files/c4ff0c9c-4b3b-4a94-a86e-3d3b64088ae0/download" \
-H "Authorization: Bearer YOUR_API_KEY" | jq -r .data.url)
curl -L -o prices.pdf "$URL"
Response
200 OK
{
"success": true,
"data": {
"url": "https://…/storage/v1/object/sign/kb/5df09066-…/c4ff0c9c-…/prices.pdf?token=eyJhbGciOi…&download=prices.pdf",
"expires_in": 60
}
}
Errors
| Code | Status | When |
|---|---|---|
CONFLICT | 409 | This file has not finished uploading. (a link upload not yet confirmed) |
NOT_FOUND | 404 | No such file: File not found. |
INTERNAL_ERROR | 500 | The download could not be started. Try again in a moment. |
Was this page helpful?
⌘I
Download file
curl --request GET \
--url https://api.verbeo.ai/v1/knowledge-base/files/{fileId}/download \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.verbeo.ai/v1/knowledge-base/files/{fileId}/download"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.verbeo.ai/v1/knowledge-base/files/{fileId}/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://api.verbeo.ai/v1/knowledge-base/files/{fileId}/download",
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.verbeo.ai/v1/knowledge-base/files/{fileId}/download"
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.verbeo.ai/v1/knowledge-base/files/{fileId}/download")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.verbeo.ai/v1/knowledge-base/files/{fileId}/download")
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