Generating PDFs

Schedaero is commonly used to generate various documents at different stages of a trip’s life: quotes for clients; tripsheets for pilots and passengers; various other reports and forms. Many of these documents can be retrieved through the api as a stream of bytes representing the PDF content of the document

Generation Links

If a resource in Schedaro API has an associated PDF document, the resource will include a ‘generate-pdf’ link providing the URI to retrieve the PDF content.

Request a resource with a generation link
GET https://sandbox-schedaero.avinode.com/api/quotes/schedaero-quote-123456789

{
    "data": {
        "id": "schedaero-quote-123456789",
        "href": "https://sandbox-schedaero.avinode.com/api/quotes/schedaero-quote-123456789",
        "type": "schedaero-quote",
        "links": {
            "generate-pdf": {
                "href": "https://sandbox-schedaero.avinode.com/api/streams/quotes/schedaero-quote-123456789"
            }
        }
    },
    "meta": {}
}

Streamed Content Retrieval


The generation URI can be requested as you would any other resource through Schedaero API. The request must include all of the normal headers as well as a valid Authorization Token.


Unlike normal requests, a request for streamed content will not return a JSON document. Instead, it will return an array of bytes that is the binary content of the file. The Content-Type and Content-Disposition headers indicate the type and name of the returned file.


Your application should save the response body to disk as a .pdf file or otherwise display the PDF content to your users.

PDF request
GET https://sandbox-schedaero.avinode.com/api/streams/quotes/schedaero-quote-123456789
X-Avinode-ApiVersion: v1
X-Avinode-ApiToken: anidentifier
Authorization: Bearer atoken
X-Avinode-SentTimestamp: 2010-01-01T00:00Z
PDF response
HTTP/1.1 200 OK
X-Avinode-ApiVersion: v1
Content-Type: application/pdf
Content-Disposition: attachment; filename="Quote N100AB (Gulfstream V)  $28,650.00"

31336166320D0A255044462D312E...

Quote PDFs

Every quote resource contains a ‘generate-pdf’ link to retrieve the current quote pdf. The PDF will be created with the formatting and settings chosen for the quote in the Schedaero application

Request
GET https://sandbox-schedaero.avinode.com/api/quotes/schedaero-quote-123456789
Response
{
    "data": {
        "id": "schedaero-quote-123456789",
        "href": "https://sandbox-schedaero.avinode.com/api/quotes/schedaero-quote-123456789",
        "type": "schedaero-quote",
        "links": {
            "generate-pdf": {
                "href": "https://sandbox-schedaero.avinode.com/api/streams/quotes/schedaero-quote-123456789"
            }
        }
    },
    "meta": {}
}

Tripsheet PDFs for Scheduled Trips

Every scheduled trip resource contains a collection of tripsheet reports, representing all PDF-formatted tripsheets that are available through the Schedaero application. Each report contains a ‘generate-pdf’ link to retrieve the corresponding document.


Tripsheets generated from a trip’s reports collection will contain all legs in the trip.

Request
GET https://sandbox-schedaero.avinode.local/api/trips/schedaero-trip-123456789/reports
Response
{
    "data": [{
            "report": {
                "name": "Passenger by leg trip sheet",
                "reportType": "PassengerTripSheet",
                "id": "report-10002",
                "href": "https://sandbox-schedaero.avinode.com/api/reports/report-10002",
                "type": "report"
            },
            "trip": {
                "id": "schedaero-trip-123456789",
                "href": "https://sandbox-schedaero.avinode.com/api/trips/schedaero-trip-123456789",
                "type": "schedaero-trip"
            },
            "id": "schedaero-trip-123456789-report-10002",
            "type": "report-trip",
            "links": {
                "generate-pdf": {
                    "href": "https://sandbox-schedaero.avinode.com/api/streams/tripsheets/schedaero-trip-123456789-report-10002"
                }
            }
        }, {
            "report": {
                "name": "Pilot by leg trip sheet",
                "reportType": "PilotTripSheet",
                "id": "report-10011",
                "href": "https://sandbox-schedaero.avinode.com/api/reports/report-10011",
                "type": "report"
            },
            "trip": {
                "id": "schedaero-trip-123456789",
                "href": "https://sandbox-schedaero.avinode.com/api/trips/schedaero-trip-123456789",
                "type": "schedaero-trip"
            },
            "id": "schedaero-trip-123456789-report-10011",
            "type": "report-trip",
            "links": {
                "generate-pdf": {
                    "href": "https://sandbox-schedaero.avinode.com/api/streams/tripsheets/schedaero-trip-123456789-report-10011"
                }
            }
        }
    ],
    "meta": {}
}

Tripsheet PDFs for Flight Legs

Every flight leg resource contains a collection of tripsheet reports, representing all PDF-formatted tripsheets that are available through the Schedaero application. Each report contains a ‘generate-pdf’ link to retrieve the corresponding document.


Tripsheets generated from a flight leg’s reports collection will contain only that leg’s information.

Request
GET https://sandbox-schedaero.avinode.com/api/flightlegs/schedaero-flightleg-123456789/reports
Response
{
    "data": [{
            "report": {
                "name": "Passenger by leg trip sheet",
                "reportType": "PassengerTripSheet",
                "id": "report-10002",
                "href": "https://sandbox-schedaero.avinode.com/api/reports/report-10002",
                "type": "report"
            },
            "leg": {
                "id": "schedaero-flightleg-123456789",
                "href": "https://sandbox-schedaero.avinode.com/api/flightlegs/schedaero-flightleg-123456789",
                "type": "schedaero-flightleg"
            },
            "id": "schedaero-flightleg-123456789-report-10002",
            "type": "report-flightleg",
            "links": {
                "generate-pdf": {
                    "href": "https://sandbox-schedaero.avinode.com/api/streams/tripsheets/schedaero-flightleg-123456789-report-10002"
                }
            }
        }, {
            "report": {
                "name": "Pilot by leg trip sheet",
                "reportType": "PilotTripSheet",
                "id": "report-10011",
                "href": "https://sandbox-schedaero.avinode.com/api/reports/report-10011",
                "type": "report"
            },
            "leg": {
                "id": "schedaero-flightleg-123456789",
                "href": "https://sandbox-schedaero.avinode.com/api/flightlegs/schedaero-flightleg-123456789",
                "type": "schedaero-flightleg"
            },
            "id": "schedaero-flightleg-123456789-report-10011",
            "type": "report-flightleg",
            "links": {
                "generate-pdf": {
                    "href": "https://sandbox-schedaero.avinode.com/api/streams/tripsheets/schedaero-flightleg-123456789-report-10011"
                }
            }
        }
    ],
    "meta": {}
}

Did this page help you?