Obtenir le PDF du devis
curl --request GET \
--url https://qwoty.app/api/projects/{id}/pdf \
--header 'Authorization: <authorization>'import requests
url = "https://qwoty.app/api/projects/{id}/pdf"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://qwoty.app/api/projects/{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://qwoty.app/api/projects/{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 => [
"Authorization: <authorization>"
],
]);
$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://qwoty.app/api/projects/{id}/pdf"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://qwoty.app/api/projects/{id}/pdf")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://qwoty.app/api/projects/{id}/pdf")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body(fichier PDF binaire)
{
"error": "Project not found"
}
{
"error": "Failed to prepare PDF"
}
Devis
Obtenir le PDF du devis
Télécharger un PDF de devis (signé si disponible, sinon non signé)
GET
/
api
/
projects
/
{id}
/
pdf
Obtenir le PDF du devis
curl --request GET \
--url https://qwoty.app/api/projects/{id}/pdf \
--header 'Authorization: <authorization>'import requests
url = "https://qwoty.app/api/projects/{id}/pdf"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://qwoty.app/api/projects/{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://qwoty.app/api/projects/{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 => [
"Authorization: <authorization>"
],
]);
$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://qwoty.app/api/projects/{id}/pdf"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://qwoty.app/api/projects/{id}/pdf")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://qwoty.app/api/projects/{id}/pdf")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body(fichier PDF binaire)
{
"error": "Project not found"
}
{
"error": "Failed to prepare PDF"
}
Autorisation
string
requis
Jeton Bearer pour l’authentification. Format :
Bearer qwoty_your_tokenParamètres de chemin
string
requis
UUID du projet
Paramètres de requête
boolean
défaut:"false"
Force la régénération du PDF avant le téléchargement. Utilisez
true pour contourner les vérifications de fraîcheur.Comportement
- Si le projet est
acceptedet qu’un PDF signé existe, le fichier signé est retourné. - Sinon, un PDF non signé est retourné (généré à la demande si nécessaire).
- La réponse est un téléchargement de fichier avec le type de contenu
application/pdf.
src/app/api/projects/[id]/pdf/route.ts (maintenu en dehors de app/api/(bff)/ en tant que contrat HTTP documenté et compatible avec les outils).
Exemples
curl --request GET \
--url "https://qwoty.app/api/projects/550e8400-e29b-41d4-a716-446655440000/pdf?force=false" \
--header "Authorization: Bearer qwoty_your_token" \
--output quote.pdf
const projectId = '550e8400-e29b-41d4-a716-446655440000'
const response = await fetch(
`https://qwoty.app/api/projects/${projectId}/pdf?force=false`,
{
headers: {
Authorization: 'Bearer qwoty_your_token',
},
},
)
if (!response.ok) {
const error = await response.json()
throw new Error(error.error)
}
const blob = await response.blob()
import requests
project_id = '550e8400-e29b-41d4-a716-446655440000'
response = requests.get(
f'https://qwoty.app/api/projects/{project_id}/pdf?force=false',
headers={
'Authorization': 'Bearer qwoty_your_token'
}
)
if response.status_code != 200:
raise Exception(response.json().get('error', 'Échec de la requête'))
with open('quote.pdf', 'wb') as f:
f.write(response.content)
Réponse
string
Toujours
application/pdf en cas de succès.string
Nom de fichier en pièce jointe. Exemple :
quote-Q-2024-001.pdf ou
quote-Q-2024-001-signed.pdf.(fichier PDF binaire)
{
"error": "Project not found"
}
{
"error": "Failed to prepare PDF"
}
Cette page vous a-t-elle été utile ?

