Estimates
List estimate PDF attachments
List estimate PDF attachments through the public API.
GET
/
v1
/
estimates
/
{estimateId}
/
pdf-attachments
List estimate PDF attachments
curl --request GET \
--url https://api.infinity.swiss/v1/estimates/{estimateId}/pdf-attachments \
--header 'x-api-token: <api-key>'import requests
url = "https://api.infinity.swiss/v1/estimates/{estimateId}/pdf-attachments"
headers = {"x-api-token": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-token': '<api-key>'}};
fetch('https://api.infinity.swiss/v1/estimates/{estimateId}/pdf-attachments', 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.infinity.swiss/v1/estimates/{estimateId}/pdf-attachments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-token: <api-key>"
],
]);
$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.infinity.swiss/v1/estimates/{estimateId}/pdf-attachments"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-token", "<api-key>")
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.infinity.swiss/v1/estimates/{estimateId}/pdf-attachments")
.header("x-api-token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.infinity.swiss/v1/estimates/{estimateId}/pdf-attachments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-token"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"attachments": [
{
"id": "<string>",
"url": "<string>",
"name": "<string>",
"type": "application/pdf",
"size": 123
}
]
}{
"code": "general/unauthorised"
}{
"code": "rest-api/insufficient-scope"
}{
"code": "customer-invoices/quote-not-found"
}Attachments are returned in attachment order, including files added through the quote editor. Each attachment includes its id, URL, original filename, content type, and size in bytes. The URL opens the file without your API key for one hour. See download an estimate PDF attachment. You need invoice-module read access.
Their pages appear after the quote pages in the generated estimate PDF. Quotes have no QR payment slip.
⌘I
List estimate PDF attachments
curl --request GET \
--url https://api.infinity.swiss/v1/estimates/{estimateId}/pdf-attachments \
--header 'x-api-token: <api-key>'import requests
url = "https://api.infinity.swiss/v1/estimates/{estimateId}/pdf-attachments"
headers = {"x-api-token": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-token': '<api-key>'}};
fetch('https://api.infinity.swiss/v1/estimates/{estimateId}/pdf-attachments', 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.infinity.swiss/v1/estimates/{estimateId}/pdf-attachments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-token: <api-key>"
],
]);
$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.infinity.swiss/v1/estimates/{estimateId}/pdf-attachments"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-token", "<api-key>")
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.infinity.swiss/v1/estimates/{estimateId}/pdf-attachments")
.header("x-api-token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.infinity.swiss/v1/estimates/{estimateId}/pdf-attachments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-token"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"attachments": [
{
"id": "<string>",
"url": "<string>",
"name": "<string>",
"type": "application/pdf",
"size": 123
}
]
}{
"code": "general/unauthorised"
}{
"code": "rest-api/insufficient-scope"
}{
"code": "customer-invoices/quote-not-found"
}