Generating PDFs
Schedaero is frequently utilized to generate a wide range of important documents throughout different stages of a trip's lifecycle. These documents may include quotes for clients, trip sheets for pilots and passengers, as well as various other reports and forms.
Through our API, it's possible to retrieve many of these documents as a stream of bytes that represent the PDF content of the document. By leveraging this approach, you can easily and securely access key information related to your business aviation operations and streamline your overall document management process.
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": {}
}
Trip Sheet PDFs for Scheduled Trips
Every scheduled trip resource contains a collection of trip sheet reports, representing all PDF-formatted trip sheets that are available through the Schedaero application. Each report contains a ‘generate-pdf’ link to retrieve the corresponding document.
Trip sheets generated from a trip’s reports collection will contain all legs in the trip.
GET https://sandbox-schedaero.avinode.local/api/trips/schedaero-trip-123456789/reports
{
"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": {}
}
Trip Sheet PDFs for Flight Legs
Every flight leg resource contains a collection of trip sheet reports, representing all PDF-formatted trip sheets that are available through the Schedaero application. Each report contains a ‘generate-pdf’ link to retrieve the corresponding document.
Trip sheets generated from a flight leg’s reports collection will contain only that leg’s information.
GET https://sandbox-schedaero.avinode.com/api/flightlegs/schedaero-flightleg-123456789/reports
{
"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": {}
}
Updated over 1 year ago