PDF eines extrahierten Dokuments abrufen
curl --request GET \
--url https://api.comstruct.com/v1/documents/{typeKey}/{id}/pdf \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.comstruct.com/v1/documents/{typeKey}/{id}/pdf"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.comstruct.com/v1/documents/{typeKey}/{id}/pdf', 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.comstruct.com/v1/documents/{typeKey}/{id}/pdf",
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-Key: <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.comstruct.com/v1/documents/{typeKey}/{id}/pdf"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<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.comstruct.com/v1/documents/{typeKey}/{id}/pdf")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.comstruct.com/v1/documents/{typeKey}/{id}/pdf")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body"<string>"Dokumente
Dokument-PDF abrufen
Erforderliche Berechtigungen: documents:read
Gibt die PDF-Bytes eines extrahierten Dokuments zurück (application/pdf).
Content-Disposition ist inline; der Dateiname ist ASCII-sicher (Zeichen außerhalb
von A-Za-z0-9._- werden zu _) und endet auf .pdf. Anhänge sind nicht enthalten.
Dieselben Zugriffsregeln wie GET /documents/{typeKey}/{id}: nur Status EXTRACTED,
nur für den Mandanten aktivierte Typen, und bei projektgebundenem API-Schlüssel nur
Dokumente dieses Projekts. Authentifizierung per API-Schlüssel (x-api-key) oder JWT.
404, wenn der Typ unbekannt oder deaktiviert ist, kein extrahiertes Dokument dieser
ID existiert oder die gespeicherte PDF fehlt.
GET
/
documents
/
{typeKey}
/
{id}
/
pdf
PDF eines extrahierten Dokuments abrufen
curl --request GET \
--url https://api.comstruct.com/v1/documents/{typeKey}/{id}/pdf \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.comstruct.com/v1/documents/{typeKey}/{id}/pdf"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.comstruct.com/v1/documents/{typeKey}/{id}/pdf', 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.comstruct.com/v1/documents/{typeKey}/{id}/pdf",
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-Key: <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.comstruct.com/v1/documents/{typeKey}/{id}/pdf"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<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.comstruct.com/v1/documents/{typeKey}/{id}/pdf")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.comstruct.com/v1/documents/{typeKey}/{id}/pdf")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body"<string>"Gibt die PDF-Bytes eines extrahierten Dokuments zurück (
application/pdf, Content-Disposition: inline). Dieselben Zugriffsregeln wie GET /documents/{typeKey}/{id}: nur Status EXTRACTED, aktivierte Typen, bei projektgebundenem API-Schlüssel nur dieses Projekt. Anhänge sind nicht enthalten. Der Dateiname im Header ist ASCII-sicher und endet auf .pdf.Autorisierungen
Pfadparameter
Antwort
PDF-Bytes
The response is of type file.