Menu

Usage

Overview

The API is called by POSTing the request as a json object to the appropriate end-point. If no basic authorisation header is supplied, the API will return a request for the Username (public key) and Password (secret). If this call was made by a modern browser, the browser will interpret this return and promt the user for a username and password, before re-submitting the request.

The normal mode of usage would be for this call to be made from the server of the 3rd party, but calling the endpoints directly from a browser can sometimes be useful during testing and development.

Endpoints

The URL for the call to the API should look like the following:

[baseURL][Endpoint]
    

Where the endpoint is one of the following:

Please note that not all endpoints are available to all clients. You can see the endpoints that you are authorised for in the list on the left menu once you have logged in.

Expected Flow

The API has been written with the following program/customer booking flow in mind:

  1. Customer enters their dates and airport to search for parking prices. The client calls the GetAllPrices endpoint to retrieve all product pricing data for these parameters
  2. Customer chooses one of the available products and adds it to their basket.
  3. On Customer Checkout, the client calls GetPrice to ensure that the product is still available and the price has not changed since the search was carried out
  4. Once availability and pricing is confirmed, the client takes the Customer payment and IMMENDIATELY moves to the next step
  5. The client calls the MakeBooking endpoint. It is advised that the time between step (3) and this step is minimised to reduce the risk of price/availability changes.
  6. The client interrogates the response value of the MakeBooking request to ensure the booking has been sucessful.

Full Code Example (c#)

The following is a fully operational code sample for the GetAllPrices endpoint. For full details of the Encapsulated Parameters, please see the later section and example regarding the GetAllPrices endpoint
Note: This code snippet is NOT intended for use in Production Code, and only serves as an indication of how to proceed. We would advise a more defensive approach for production code, with error handling, etc.
    

        string content = "{ \"parkingFrom\": \"2024-10-19T12:00:00\", \"parkingTo\": \"2024-10-29T18:30:00\", \"airportCode": \"LGW\" }";
        string url = string.Format("{0}/GetAllPrices", [BASE_URL]]);
        using (var client = new HttpClient())
        {
            var byteArray = Encoding.ASCII.GetBytes(string.Format("{0}:{1}", [PUBLIC_KEY], [SECRET]));
            var hdr = new AuthenticationHeaderValue("Basic", Convert.ToBase64String(byteArray));
            client.DefaultRequestHeaders.Authorization = hdr;
            client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
            HttpResponseMessage response =client.PostAsync(url, new StringContent(body, Encoding.UTF8, "application/json")).Result;
            string resultContent = response.Content.ReadAsStringAsync().Result;
        }
    

Alternatively, here is the same call using curl:

    
curl -X 'POST' \
  'https://localhost:44391/GetAllPrices' \
  -H 'accept: */*' \
  -H 'Authorization: Basic xxx0xxxxNTc4OTQ1a2RiIDpoZmdkdTc2MzNeaGxxxxx=' \
  -H 'Content-Type: application/json' \
  -d '{
  "parkingFrom": "2024-10-19T12:00:00",
  "parkingTo": "2024-10-29T18:00:00",
  "airportCode": "LGW"
}'
    

The Response

If the public key and secret are authenticated, the response from the API will be in the form of a json object. Otherwise a 401 Unauthorized response will be sent.
An example of a typical response to the above GetAllPrices request is as follows:
    
[
  {
    "productCode": "600",
    "productName": "test product name",
    "airportCode": "LGW",
    "productUnavailable": false,
    "unavailableReason": null,
    "price": 66.0000,
    "aaf": 10.0000
  },
  {
    "productCode": "601",
    "productName": "test2 product",
    "airportCode": "LGW",
    "productUnavailable": false,
    "unavailableReason": null,
    "price": 63.0000,
    "aaf": 5.0000
  },
  {
    "productCode": "608",
    "productName": "Unavailable product",
    "airportCode": "LGW",
    "productUnavailable": true,
    "unavailableReason": "closeout",
    "price": 0,
    "aaf": 0
  }
]