Baixar arquivo da fatura
curl --request GET \
--url https://api.pipo.health/v1/invoices/{invoice-id}/download \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.pipo.health/v1/invoices/{invoice-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.pipo.health/v1/invoices/{invoice-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.pipo.health/v1/invoices/{invoice-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.pipo.health/v1/invoices/{invoice-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.pipo.health/v1/invoices/{invoice-id}/download")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pipo.health/v1/invoices/{invoice-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"<string>"{
"error": "Invoice not found"
}{
"error": "Invoice file storage unavailable"
}Baixar arquivo da fatura
Retorna o conteúdo do arquivo diretamente (streaming), e não uma URL de download.
Sem file-id, retorna o ZIP com todos os arquivos da fatura (invoice-files.zip);
com file-id, retorna apenas o arquivo especificado, com o Content-Type e o nome
(via Content-Disposition) do arquivo original.
GET
/
v1
/
invoices
/
{invoice-id}
/
download
Baixar arquivo da fatura
curl --request GET \
--url https://api.pipo.health/v1/invoices/{invoice-id}/download \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.pipo.health/v1/invoices/{invoice-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.pipo.health/v1/invoices/{invoice-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.pipo.health/v1/invoices/{invoice-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.pipo.health/v1/invoices/{invoice-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.pipo.health/v1/invoices/{invoice-id}/download")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pipo.health/v1/invoices/{invoice-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"<string>"{
"error": "Invoice not found"
}{
"error": "Invoice file storage unavailable"
}Authorizations
Token Bearer obtido em POST /v1/authenticate.
Path Parameters
ID da fatura.
Query Parameters
ID de um arquivo específico da fatura, obtido em files[].file-id.
Response
Conteúdo binário do arquivo. Content-Type é application/zip quando file-id não
é informado (ZIP com todos os arquivos), application/pdf para boletos, ou
application/octet-stream como fallback. Content-Disposition traz o nome do
arquivo (ex.: attachment; filename="boleto-01.pdf").
The response is of type file.