Skip to content
Developers
esc
  • Type an endpoint, an object or a word from a guide.

Agreements

Retrieve the archived PDF

GET /api/v1/reservations/{id}/agreement/document

The bytes archived for the current agreement, as application/pdf.

Path parameters

ParameterInTypeDescription
id requiredpathstringThe reservation id.

Response

200 The document, as application/pdf.

Errors

Every failure is { error, message }; see Errors. A missing or expired bearer is a 401 on every endpoint but the token exchange.

StatuserrorWhen
404not_foundUnknown reservation, or no document has been archived for its current agreement.

Request

curl "https://go.quarters.live/api/v1/reservations/7c02…/agreement/document" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -o agreement.pdf
import { writeFile } from "node:fs/promises";

const res = await fetch("https://go.quarters.live/api/v1/reservations/7c02…/agreement/document", {
  headers: { Authorization: `Bearer ${token}` }
});
await writeFile("agreement.pdf", Buffer.from(await res.arrayBuffer()));
import requests

res = requests.get(
    "https://go.quarters.live/api/v1/reservations/7c02…/agreement/document",
    headers={"Authorization": f"Bearer {token}"},
)
res.raise_for_status()
open("agreement.pdf", "wb").write(res.content)
$ch = curl_init("https://go.quarters.live/api/v1/reservations/7c02…/agreement/document");
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => ["Authorization: Bearer $token"],
]);
$res = curl_exec($ch);
curl_close($ch);
file_put_contents("agreement.pdf", $res);
require "net/http"
require "json"

uri = URI("https://go.quarters.live/api/v1/reservations/7c02…/agreement/document")
req = Net::HTTP::Get.new(uri)
req["Authorization"] = "Bearer #{token}"
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(req) }
File.binwrite("agreement.pdf", res.body)
package main

import (
	"fmt"
	"io"
	"net/http"
	"os"
)

func main() {
	token := os.Getenv("ACCESS_TOKEN")
	req, _ := http.NewRequest("GET", "https://go.quarters.live/api/v1/reservations/7c02…/agreement/document", nil)
	req.Header.Set("Authorization", "Bearer "+token)
	res, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()
	out, _ := os.Create("agreement.pdf")
	defer out.Close()
	io.Copy(out, res.Body)
	fmt.Println(res.Status)
}

Response · 200

Content-Type: application/pdf
Content-Disposition: inline; filename="agreement-7c02….pdf"

<bytes>