Gerar download
curl --request GET \
--url https://api.lazydata.com.br/v1/storage/files/{file_id}/download \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.lazydata.com.br/v1/storage/files/{file_id}/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.lazydata.com.br/v1/storage/files/{file_id}/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.lazydata.com.br/v1/storage/files/{file_id}/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.lazydata.com.br/v1/storage/files/{file_id}/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.lazydata.com.br/v1/storage/files/{file_id}/download")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lazydata.com.br/v1/storage/files/{file_id}/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{
"code": 200,
"message": "Link de download gerado.",
"result": {
"url": "https://s3.amazonaws.com/exemplo-assinado",
"file_name": "contrato.pdf",
"file": {
"id": "9fcb573b-7f62-4774-978b-07e89dfef5f2",
"type": "file",
"name": "contrato.pdf",
"parent_id": null,
"extension": "pdf",
"content_type": "application/pdf",
"size": 24576,
"status": "uploaded",
"uploaded_at": "2026-06-22T12:00:00+00:00",
"created_at": "2026-06-22T11:59:40+00:00",
"updated_at": "2026-06-22T12:00:00+00:00"
}
}
}
{
"code": 404,
"message": "Arquivo não localizado."
}
Armazenamento
Gerar download
Gere um link temporário para baixar um arquivo armazenado.
GET
https://api.lazydata.com.br/
/
v1
/
storage
/
files
/
{file_id}
/
download
Gerar download
curl --request GET \
--url https://api.lazydata.com.br/v1/storage/files/{file_id}/download \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.lazydata.com.br/v1/storage/files/{file_id}/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.lazydata.com.br/v1/storage/files/{file_id}/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.lazydata.com.br/v1/storage/files/{file_id}/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.lazydata.com.br/v1/storage/files/{file_id}/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.lazydata.com.br/v1/storage/files/{file_id}/download")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lazydata.com.br/v1/storage/files/{file_id}/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{
"code": 200,
"message": "Link de download gerado.",
"result": {
"url": "https://s3.amazonaws.com/exemplo-assinado",
"file_name": "contrato.pdf",
"file": {
"id": "9fcb573b-7f62-4774-978b-07e89dfef5f2",
"type": "file",
"name": "contrato.pdf",
"parent_id": null,
"extension": "pdf",
"content_type": "application/pdf",
"size": 24576,
"status": "uploaded",
"uploaded_at": "2026-06-22T12:00:00+00:00",
"created_at": "2026-06-22T11:59:40+00:00",
"updated_at": "2026-06-22T12:00:00+00:00"
}
}
}
{
"code": 404,
"message": "Arquivo não localizado."
}
Gera um link temporário para baixar um arquivo do armazenamento.
O link retornado é assinado, temporário e deve ser usado apenas pelo consumidor autorizado.
{
"code": 200,
"message": "Link de download gerado.",
"result": {
"url": "https://s3.amazonaws.com/exemplo-assinado",
"file_name": "contrato.pdf",
"file": {
"id": "9fcb573b-7f62-4774-978b-07e89dfef5f2",
"type": "file",
"name": "contrato.pdf",
"parent_id": null,
"extension": "pdf",
"content_type": "application/pdf",
"size": 24576,
"status": "uploaded",
"uploaded_at": "2026-06-22T12:00:00+00:00",
"created_at": "2026-06-22T11:59:40+00:00",
"updated_at": "2026-06-22T12:00:00+00:00"
}
}
}
{
"code": 404,
"message": "Arquivo não localizado."
}
Parâmetros
string
required
ID do arquivo.
Resposta
| Campo | Tipo | Descrição |
|---|---|---|
url | string | Link temporário para download. |
file_name | string | Nome sugerido do arquivo. |
file | object | Metadados do arquivo. |
Não armazene links temporários como referência permanente. Gere um novo link sempre que precisar baixar o arquivo.
⌘I

