Extract Data to Your External System
This use case involves extracting data from Schedaero for reporting purposes, which can be exported to platforms like Power BI, Tableau, and Zoho. The data can also be exported in file formats such as CSV and Excel for further analysis.
Overview
Having up-to-date information is crucial when analyzing report data. You can pull the latest data from Schedaero for comparison in your external software.
Schedaero APIs allow for various reporting use cases, such as generating reports for completed flights and crew information attached to a specific tail number for an owner's review. This could include airport pairs, hours flown, pilots that were assigned to the flight, and passenger lists if required.
You can also extract expenses attached to a specific trip or summarize them by aircraft within a timeframe.
You can manipulate the extracted data within your reporting software to obtain the specific information your company requires. The level of detail within each area will depend on your needs.
Additionally, you can extract data to CSV or Excel if you don't have a specific application for reporting.
Available data
The availability of information to extract from Schedaero depends on the features utilized within your organization.
Pre-requisites
Gaining an understanding of our APIs and fundamentals is essential to the success of your project. To do so, start by reading our introduction page, including the pages linked in the "Before you start developing" section.
It's also important to be familiar with the concept of webhooks and how they work.
The next step is to curate the information you need. As mentioned above, this will depend on the parts of the website you utilize. Once you have a better understanding of what you'd like to pull through the API, you can compare it to the swagger documentation to make sure it's available.
Helpful tip
We recommend creating a checklist of the specific data points that you need. This will help you identify the specific points in the system that you would like to extract and, if needed, enable our API team to help match up specific permissions.
Permissions Gathering
As a part of the project, you will collaborate with our API team to tailor your permissions based on your specific data requirements. The information you require will dictate the appropriate level of permissions that need to be granted to your API account. It is worth noting that certain endpoints of our API have the capability to write data to our system. Therefore, providing clear specifications on the intended actions can aid in streamlining the permissions-gathering process.
Should the need arise, additional permissions are usually granted on request. Permissions can always be updated/adjusted as your needs change during development, as well as after you "go live" in our production environment.
Once the permissions are defined, next steps would be to grant access to the sandbox environment.
Please note
If your project requires a specific data point that is not currently available in the API, please inform your account manager.
Implementation & API Examples
Past Scheduled Trips
Retrieving past scheduled trips for a specific tail can be a useful dataset for usage reports presented to owners when extracting data to your external reporting system.
To begin, you need to obtain the internal IDs for your aircraft:
GET https://sandbox-schedaero.avinode.com/api/lift/fleet
This will return information about the fleet:
{
"aircraftCategory": "Ultra long range",
"registrationNumber": "DEMO9",
"aircraftType": {
"aircraftType": "Gulfstream G550",
"schedaeroTypeCode": "G-550",
... snip ....
"id": "schedaero-lift-2918-A-38172", <-- This is the ID to use
... snip ...
"type": "schedaero-lift",
"links": {
After obtaining the internal ID of your aircraft, you can use it in the. Below request example will retrieve all flight legs in the past, along with the following specific filters to clarify the results:
- From/to (departure and arrival airports)
- departUtc, arriveUtc
- blockMinutes
- currentPassengerCount
- requester
- tripNumber
GET https://sandbox-schedaero.avinode.com/api/lift/schedaero-lift-2918-A-38172/flightlegs/past?fields[leg]=from,to,departUtc,arriveUtc,blockMinutes,currentPassengerCount,trip&fields[trip]=requester,tripNumber
The API call above will return the requested details of the flights flown with the specified aircraft, as shown in the example below for a single trip:
{
"trip": {
"requester": {
"first": "Jeremy",
"last": "Customer",
"id": "contact-12345",
"href": "https://sandbox-schedaero.avinode.com/api/contacts/people/contact-11111111",
"type": "contact-person",
"links": {
... snip ...
},
"quoteNumber": "12345678",
"scheduledTripNumber": "12345678",
"id": "schedaero-trip-12345678",
"href": "https://sandbox-schedaero.avinode.com/api/trips/schedaero-trip-12345678",
"type": "schedaero-trip",
"links": {
... snip ...
},
"currentPassengerCount": 0,
"from": {
"icao": "KBCT",
"iata": "BCT",
"faa": "BCT",
"id": "aport-8531",
"href": "https://sandbox-schedaero.avinode.com/api/airports/details/aport-8531",
"type": "schedaero-airport"
},
"to": {
"icao": "KPNE",
"iata": "PNE",
"faa": "PNE",
"id": "aport-16349",
"href": "https://sandbox-schedaero.avinode.com/api/airports/details/aport-16349",
"type": "schedaero-airport"
},
"departUtc": "2015-03-25T17:23:00Z",
"arriveUtc": "2015-03-25T19:39:00Z",
"blockMinutes": 136,
"id": "schedaero-flightleg-1166060",
"href": "https://sandbox-schedaero.avinode.com/api/flightlegs/schedaero-flightleg-111111111",
"type": "schedaero-flightleg",
"links": {
... snip ...
Pagination
Refer to the pagination section for information on how to handle pagination, as the initial call to retrieve this information may contain a large amount of data.
Flight Expenses
Another useful resource is knowing the expenses incurred on a flight. See the below example:
https://sandbox-schedaero.avinode.com/api/trips/schedaero-trip-12345678/expenses
The API call returns both the expenses and the trip information:
{
"data": [
{
"trip": {
"id": "schedaero-trip-12345678",
... snip ...
"paymentType": {
"name": "Amex - 5089",
"standardCode": "None",
"id": "schedaero-trip-expense-payment-type-xx",
"type": "schedaero-expense-payment-type"
},
"paidBy": {
"name": "Halstead, Darren",
"id": "schedaero-trip-expense-paid-by-person-123456",
"type": "schedaero-expense-paid-by"
},
"date": "2022-11-16T00:00:00",
"currencyCode": "USD",
"total": 1500.0000000,
"isItemized": false,
... snip ...
},
"paidBy": {
"name": "JERFORCE1",
"id": "schedaero-trip-expense-paid-by-aircraft-54321",
"type": "schedaero-expense-paid-by"
},
"date": "2022-11-15T00:00:00",
"currencyCode": "USD",
"total": 4830.0000000,
"isItemized": false,
... snip ...
}
},
"paymentType": {
"name": "Cash",
"standardCode": "Cash",
"id": "schedaero-trip-expense-payment-type-31",
"type": "schedaero-expense-payment-type"
},
"paidBy": {
"name": "Dummy, Crash",
"id": "schedaero-trip-expense-paid-by-person-123123",
"type": "schedaero-expense-paid-by"
},
"date": "2022-11-17T00:00:00",
"currencyCode": "USD",
"total": 119.8500000,
"isItemized": false,
... snip ...
}
Customer Quotes
It is possible to fetch all the quote information for a specific customer and then, if needed, also retrieve details from those specific quotes.
https://sandbox-schedaero.avinode.com/api/contacts/people/contact-1234566/trips/quoted
And the details:
{
"data": [
{
"id": "schedaero-trip-11111111",
... snip ...
{
"id": "schedaero-trip-22222222",
... snip ...
{
"id": "schedaero-trip-33333333",
... snip ...
{
"id": "schedaero-trip-44444444",
... snip ...
{
"id": "schedaero-trip-55555555",
... snip ...
{
"id": "schedaero-trip-66666666",
... snip ...
{
"id": "schedaero-trip-77777777",
... snip ...
{
"id": "schedaero-trip-88888888",
... snip ...
{
"id": "schedaero-trip-99999999",
... snip ...
{
"id": "schedaero-trip-00000000",
... snip ...
},
{
"id": "schedaero-trip-12345678",
... snip ...
"links": {
"first": {
"href": "https://sandbox-schedaero.avinode.com/api/contacts/people/contact-12345/trips/quoted?page%5bnumber%5d=0&page%5bsize%5d=100"
}
},
"meta": {
"copyright": "Copyright © 2001-2023 Avinode AB",g
"pagination": {
"totalCount": 11,
"pageNumber": 0,
"batchSize": 100
}
}
}
Pagination
To retrieve large amounts of existing data, it's recommended to split them up into smaller requests using pagination. The initial response will typically include information on how to paginate, such as
"pagination": {
"totalCount": 709,
"pageNumber": 0,
"batchSize": 100
}
The response shows that there are 709 records in total, with the initial response containing 100 of them and labeled as 'page 0'. By default, our responses have a batch size of 100. To retrieve the remaining records, you can include the pageNumber parameter in your request:
https://sandbox-schedaero.avinode.com/api/contacts/people/contact-12345/trips/quoted?page[number]=1&page[size]=100&fields[trip]=requester&fields[quote]=trip
This will retrieve the next 100 results (page[number]=1&page[size]=100). Repeating this process until no more results are returned will allow you to extract all the data required to synchronize the information between the Schedaero system and your external system.
Webhooks
Setting up webhooks is the most efficient way to stay updated on the specific information you're interested in. For instance, a webhook configured for Scheduled Trips will send notifications to your endpoint whenever there is an update to an existing trip or a new trip is created.
Posting to the endpoint below:
https://sandbox.avinode.com/api/webhook/settings
With the following:
{
"targetURI": "https://myapplication.com/notifications",
"displayName": "Schedaero Scheduled Trip Changes",
"active": true,
"clientIdentifier": "myapplication",
"clientSecret": "secret",
"clientAuthenticationType": "BASIC",
"eventTypes": [
"SchedAeroScheduledTrips"
]
}
This will trigger an alert whenever an existing trip is updated or a new trip is created.
{"id":"schedaero-trip-12345678",
"href":"https://schedaero.avinode.com/api/trips/schedaero-trip-12345678",
"type":
"schedaero-trip"}
Please note
The webhook only provides notification of changes made but not the actual changes. Therefore, it's necessary to use the IDs sent in the webhook to retrieve the updated information.
More information can be found on the Schedaero Webhooks page.
Go Live!
Before going live with your project, it's essential to ensure that certain key points have been checked off. This will help to minimize the risk of errors or other issues that could impact the performance of your system.
Implementation Checklist
Here's a checklist of important points to consider before going live with your project:
- All necessary webhook notifications are correctly set up and utilized in order to avoid an overabundance of requests to the endpoints.
- Token(s) are kept secure. They grant access to sensitive information, and should only be utilized by the team/project originally granted permission.
Updated 4 months ago