Scheduling API

API change history

Reservations: Fetch List

Reservations: Fetch List

Request

Request URL

Request headers

  • string
    Your API Key

Request parameters

  • int

    Your operator id

  • (optional)
    int

    Restricts the number of items returned in the response. Valid values: 1 through 250. Defaults to 50 if not supplied.

  • (optional)
    int

    Specifies which page of items to be returned in the response. Default is 0.

  • (optional)
    string

    Filter by Start Time. Supported operators: "lte", "lt", "gte", "gt". If you want to return reservations with a start time greater than or equal to Jan. 1st 2020, your query string should look like this "startTime=gte:2020-01-01T00:00:00".

  • (optional)
    string

    Filter by Start Time. Supported operators: "lte", "lt", "gte", "gt". If you want to return reservations with a end time greater than or equal to Jan. 1st 2020, your query string should look like this "endTime=gte:2020-01-01T00:00:00".

  • (optional)
    string

    Filter by display type. Supported operators: "eq". 0 - Standard, 1 - Maintenance, 2 - Class, 3 - Meeting, 10 - Instructor Time Off

  • (optional)
    string

    Filters the response by User Id. Supported operators: "eq".

Request body

Not Applicable

Responses

200 OK

Fetch all Reservations

Examples

{
  "totalItems": 2,
  "offset": 0,
  "limit": 50,
  "items": [
    {
      "reservationId": "fec1d297-fabc-4bb8-aca4-2ba5aed06713",
      "operatorId": 100467,
      "recurringSeries": null,
      "startTime": "2020-03-10T09:00:00Z",
      "endTime": "2020-03-10T10:00:00Z",
      "displayName": null,
      "reservationType": {
        "reservationTypeId": "5f0bc159-3ef5-41ad-a19a-792e85aae1dc",
        "displayTypeId": 0,
        "name": "Dual Flight Training"
      },
      "activityType": {
        "activityTypeId": "5f0bc159-3ef5-41ad-a19a-792e85aae1dc",
        "name": "Dual Flight Training",
        "displayTypeId": 0,
        "trackTrainingMismatch": true
      },
      "aircraft": {
        "aircraftId": "31586b1c-840f-4899-82a2-28bbd8741b3b",
        "tailNumber": "N8877",
        "trackCycles": null,
        "trackOilFuel": null,
        "hasAirtimeMeter": false,
        "hasHeaterHobbs": false,
        "hasHobbs": false,
        "isComplex": false,
        "isHighPerformance": false,
        "isTailWheel": false,
        "location": null,
        "make": {
          "makeId": "a221cefa-de15-4e4a-aae5-2c470470ee85",
          "name": "Cessna"
        },
        "model": {
          "modelId": "fbf894a2-9542-4544-a056-cdf7977b3b7e",
          "name": "150"
        },
        "engines": [],
        "aircraftClass": "ASEL",
        "isSimulator": false,
        "categoryClass": {
          "id": "ASEL",
          "category": "Airplane",
          "class": "Single Engine Land",
          "isSimulator": false
        },
        "isV3Simulator": false,
        "v3SimulatorId": null,
        "v3SimulatorName": null
      },
      "aircraftOption": {
        "aircraft": {
          "aircraftId": "31586b1c-840f-4899-82a2-28bbd8741b3b",
          "tailNumber": "N8877",
          "bookingAlert": null,
          "make": {
            "makeId": "a221cefa-de15-4e4a-aae5-2c470470ee85",
            "name": "Cessna"
          },
          "model": {
            "modelId": "fbf894a2-9542-4544-a056-cdf7977b3b7e",
            "name": "150"
          }
        },
        "schedulingGroup": null,
        "v3Simulator": null
      },
      "pilots": [
        {
          "userId": "b42416c7-391f-4895-9313-6214ff45636d",
          "firstName": "James",
          "lastName": "Lenox (admin)",
          "imageUrl": null,
          "phone": null,
          "locations": []
        }
      ],
      "instructor": null,
      "training": {
        "scheduled": null,
        "sessions": [
          {
            "trainingSessionId": "364011a6-7630-4f41-9bc4-da4f029ce3e0",
            "trainingSessionStatus": {
              "id": 3,
              "name": "Passed"
            },
            "course": {
              "courseId": "97a5452b-4678-4b9b-be2a-bb24fa7e6e3b",
              "name": "LENOX Private",
              "syllabusProviderId": null,
              "logoUrl": null,
              "enrollmentId": "cf3f4d5d-bbda-41e6-ae83-a7a6fac21d10"
            },
            "lesson": {
              "lessonId": "c81f4881-9df7-48d3-9a18-aeb6e2bea0c0",
              "name": "Lesson 1-1-1"
            },
            "trainingSessionDate": "2020-03-10T09:00:00Z"
          }
        ]
      },
      "reservationStatus": {
        "id": 2,
        "name": "Completed"
      }
    },
    {
      "reservationId": "88a56423-f4f4-4c8a-8ede-bf1979ffbd2b",
      "operatorId": 100467,
      "recurringSeries": null,
      "startTime": "2020-03-10T11:00:00Z",
      "endTime": "2020-03-10T12:00:00Z",
      "displayName": null,
      "reservationType": {
        "reservationTypeId": "5f0bc159-3ef5-41ad-a19a-792e85aae1dc",
        "displayTypeId": 0,
        "name": "Dual Flight Training"
      },
      "activityType": {
        "activityTypeId": "5f0bc159-3ef5-41ad-a19a-792e85aae1dc",
        "name": "Dual Flight Training",
        "displayTypeId": 0,
        "trackTrainingMismatch": true
      },
      "aircraft": {
        "aircraftId": "31586b1c-840f-4899-82a2-28bbd8741b3b",
        "tailNumber": "N8877",
        "trackCycles": null,
        "trackOilFuel": null,
        "hasAirtimeMeter": false,
        "hasHeaterHobbs": false,
        "hasHobbs": false,
        "isComplex": false,
        "isHighPerformance": false,
        "isTailWheel": false,
        "location": null,
        "make": {
          "makeId": "a221cefa-de15-4e4a-aae5-2c470470ee85",
          "name": "Cessna"
        },
        "model": {
          "modelId": "fbf894a2-9542-4544-a056-cdf7977b3b7e",
          "name": "150"
        },
        "engines": [],
        "aircraftClass": "ASEL",
        "isSimulator": false,
        "categoryClass": {
          "id": "ASEL",
          "category": "Airplane",
          "class": "Single Engine Land",
          "isSimulator": false
        },
        "isV3Simulator": false,
        "v3SimulatorId": null,
        "v3SimulatorName": null
      },
      "aircraftOption": {
        "aircraft": {
          "aircraftId": "31586b1c-840f-4899-82a2-28bbd8741b3b",
          "tailNumber": "N8877",
          "bookingAlert": null,
          "make": {
            "makeId": "a221cefa-de15-4e4a-aae5-2c470470ee85",
            "name": "Cessna"
          },
          "model": {
            "modelId": "fbf894a2-9542-4544-a056-cdf7977b3b7e",
            "name": "150"
          }
        },
        "schedulingGroup": null,
        "v3Simulator": null
      },
      "pilots": [
        {
          "userId": "b42416c7-391f-4895-9313-6214ff45636d",
          "firstName": "James",
          "lastName": "Lenox (admin)",
          "imageUrl": null,
          "phone": null,
          "locations": []
        }
      ],
      "instructor": null,
      "training": {
        "scheduled": null,
        "sessions": [
          {
            "trainingSessionId": "60e82647-6f0c-421c-9586-9cd550fd09f6",
            "trainingSessionStatus": {
              "id": 3,
              "name": "Passed"
            },
            "course": {
              "courseId": "97a5452b-4678-4b9b-be2a-bb24fa7e6e3b",
              "name": "LENOX Private",
              "syllabusProviderId": null,
              "logoUrl": null,
              "enrollmentId": "cf3f4d5d-bbda-41e6-ae83-a7a6fac21d10"
            },
            "lesson": {
              "lessonId": "c81f4881-9df7-48d3-9a18-aeb6e2bea0c0",
              "name": "Lesson 1-1-1"
            },
            "trainingSessionDate": "2020-03-10T11:00:00Z"
          }
        ]
      },
      "reservationStatus": {
        "id": 2,
        "name": "Completed"
      }
    }
  ]
}

Code samples

@ECHO OFF

curl -v -X GET "https://usc-api.flightschedulepro.com/scheduling/v1.0/operators/{operatorId}/reservations?limit={int}&offset={int}&startTime={string}&endTime={string}&displayTypeId={string}&userId={string}"
-H "x-subscription-key: {subscription key}"

--data-ascii "{body}" 
using System;
using System.Net.Http.Headers;
using System.Text;
using System.Net.Http;
using System.Web;

namespace CSHttpClientSample
{
    static class Program
    {
        static void Main()
        {
            MakeRequest();
            Console.WriteLine("Hit ENTER to exit...");
            Console.ReadLine();
        }
        
        static async void MakeRequest()
        {
            var client = new HttpClient();
            var queryString = HttpUtility.ParseQueryString(string.Empty);

            // Request headers
            client.DefaultRequestHeaders.Add("x-subscription-key", "{subscription key}");

            // Request parameters
            queryString["limit"] = "{int}";
            queryString["offset"] = "{int}";
            queryString["startTime"] = "{string}";
            queryString["endTime"] = "{string}";
            queryString["displayTypeId"] = "{string}";
            queryString["userId"] = "{string}";
            var uri = "https://usc-api.flightschedulepro.com/scheduling/v1.0/operators/{operatorId}/reservations?" + queryString;

            var response = await client.GetAsync(uri);
        }
    }
}	
// // This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
import java.net.URI;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.utils.URIBuilder;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;

public class JavaSample 
{
    public static void main(String[] args) 
    {
        HttpClient httpclient = HttpClients.createDefault();

        try
        {
            URIBuilder builder = new URIBuilder("https://usc-api.flightschedulepro.com/scheduling/v1.0/operators/{operatorId}/reservations");

            builder.setParameter("limit", "{int}");
            builder.setParameter("offset", "{int}");
            builder.setParameter("startTime", "{string}");
            builder.setParameter("endTime", "{string}");
            builder.setParameter("displayTypeId", "{string}");
            builder.setParameter("userId", "{string}");

            URI uri = builder.build();
            HttpGet request = new HttpGet(uri);
            request.setHeader("x-subscription-key", "{subscription key}");


            // Request body
            StringEntity reqEntity = new StringEntity("{body}");
            request.setEntity(reqEntity);

            HttpResponse response = httpclient.execute(request);
            HttpEntity entity = response.getEntity();

            if (entity != null) 
            {
                System.out.println(EntityUtils.toString(entity));
            }
        }
        catch (Exception e)
        {
            System.out.println(e.getMessage());
        }
    }
}

<!DOCTYPE html>
<html>
<head>
    <title>JSSample</title>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
</head>
<body>

<script type="text/javascript">
    $(function() {
        var params = {
            // Request parameters
            "limit": "{int}",
            "offset": "{int}",
            "startTime": "{string}",
            "endTime": "{string}",
            "displayTypeId": "{string}",
            "userId": "{string}",
        };
      
        $.ajax({
            url: "https://usc-api.flightschedulepro.com/scheduling/v1.0/operators/{operatorId}/reservations?" + $.param(params),
            beforeSend: function(xhrObj){
                // Request headers
                xhrObj.setRequestHeader("x-subscription-key","{subscription key}");
            },
            type: "GET",
            // Request body
            data: "{body}",
        })
        .done(function(data) {
            alert("success");
        })
        .fail(function() {
            alert("error");
        });
    });
</script>
</body>
</html>
#import <Foundation/Foundation.h>

int main(int argc, const char * argv[])
{
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    
    NSString* path = @"https://usc-api.flightschedulepro.com/scheduling/v1.0/operators/{operatorId}/reservations";
    NSArray* array = @[
                         // Request parameters
                         @"entities=true",
                         @"limit={int}",
                         @"offset={int}",
                         @"startTime={string}",
                         @"endTime={string}",
                         @"displayTypeId={string}",
                         @"userId={string}",
                      ];
    
    NSString* string = [array componentsJoinedByString:@"&"];
    path = [path stringByAppendingFormat:@"?%@", string];

    NSLog(@"%@", path);

    NSMutableURLRequest* _request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:path]];
    [_request setHTTPMethod:@"GET"];
    // Request headers
    [_request setValue:@"{subscription key}" forHTTPHeaderField:@"x-subscription-key"];
    // Request body
    [_request setHTTPBody:[@"{body}" dataUsingEncoding:NSUTF8StringEncoding]];
    
    NSURLResponse *response = nil;
    NSError *error = nil;
    NSData* _connectionData = [NSURLConnection sendSynchronousRequest:_request returningResponse:&response error:&error];

    if (nil != error)
    {
        NSLog(@"Error: %@", error);
    }
    else
    {
        NSError* error = nil;
        NSMutableDictionary* json = nil;
        NSString* dataString = [[NSString alloc] initWithData:_connectionData encoding:NSUTF8StringEncoding];
        NSLog(@"%@", dataString);
        
        if (nil != _connectionData)
        {
            json = [NSJSONSerialization JSONObjectWithData:_connectionData options:NSJSONReadingMutableContainers error:&error];
        }
        
        if (error || !json)
        {
            NSLog(@"Could not parse loaded json with error:%@", error);
        }
        
        NSLog(@"%@", json);
        _connectionData = nil;
    }
    
    [pool drain];

    return 0;
}
<?php
// This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
require_once 'HTTP/Request2.php';

$request = new Http_Request2('https://usc-api.flightschedulepro.com/scheduling/v1.0/operators/{operatorId}/reservations');
$url = $request->getUrl();

$headers = array(
    // Request headers
    'x-subscription-key' => '{subscription key}',
);

$request->setHeader($headers);

$parameters = array(
    // Request parameters
    'limit' => '{int}',
    'offset' => '{int}',
    'startTime' => '{string}',
    'endTime' => '{string}',
    'displayTypeId' => '{string}',
    'userId' => '{string}',
);

$url->setQueryVariables($parameters);

$request->setMethod(HTTP_Request2::METHOD_GET);

// Request body
$request->setBody("{body}");

try
{
    $response = $request->send();
    echo $response->getBody();
}
catch (HttpException $ex)
{
    echo $ex;
}

?>
########### Python 2.7 #############
import httplib, urllib, base64

headers = {
    # Request headers
    'x-subscription-key': '{subscription key}',
}

params = urllib.urlencode({
    # Request parameters
    'limit': '{int}',
    'offset': '{int}',
    'startTime': '{string}',
    'endTime': '{string}',
    'displayTypeId': '{string}',
    'userId': '{string}',
})

try:
    conn = httplib.HTTPSConnection('usc-api.flightschedulepro.com')
    conn.request("GET", "/scheduling/v1.0/operators/{operatorId}/reservations?%s" % params, "{body}", headers)
    response = conn.getresponse()
    data = response.read()
    print(data)
    conn.close()
except Exception as e:
    print("[Errno {0}] {1}".format(e.errno, e.strerror))

####################################

########### Python 3.2 #############
import http.client, urllib.request, urllib.parse, urllib.error, base64

headers = {
    # Request headers
    'x-subscription-key': '{subscription key}',
}

params = urllib.parse.urlencode({
    # Request parameters
    'limit': '{int}',
    'offset': '{int}',
    'startTime': '{string}',
    'endTime': '{string}',
    'displayTypeId': '{string}',
    'userId': '{string}',
})

try:
    conn = http.client.HTTPSConnection('usc-api.flightschedulepro.com')
    conn.request("GET", "/scheduling/v1.0/operators/{operatorId}/reservations?%s" % params, "{body}", headers)
    response = conn.getresponse()
    data = response.read()
    print(data)
    conn.close()
except Exception as e:
    print("[Errno {0}] {1}".format(e.errno, e.strerror))

####################################
require 'net/http'

uri = URI('https://usc-api.flightschedulepro.com/scheduling/v1.0/operators/{operatorId}/reservations')

query = URI.encode_www_form({
    # Request parameters
    'limit' => '{int}',
    'offset' => '{int}',
    'startTime' => '{string}',
    'endTime' => '{string}',
    'displayTypeId' => '{string}',
    'userId' => '{string}'
})
if query.length > 0
  if uri.query && uri.query.length > 0
    uri.query += '&' + query
  else
    uri.query = query
  end
end

request = Net::HTTP::Get.new(uri.request_uri)
# Request headers
request['x-subscription-key'] = '{subscription key}'
# Request body
request.body = "{body}"

response = Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') do |http|
    http.request(request)
end

puts response.body