Link Search Menu Expand Document

API Query Params

A CTAPIQueryParams object must be created and initialised after initialising the SDK to make requests using our API methods.


Example CTAPIQueryParams

import CarTrawlerSDK

let params = CTAPIQueryParams()  
params.delegate = self
params.clientID = "your clientID"
params.countryCode = "IE" // The country code associated with the device’s system region is used by default.
params.currencyCode = "EUR" // The currency associated with the device’s system region is used by default.
params.languageCode = "EN" // The language associated with the device’s system region is used by default.
params.iataCode = "DUB" // use IATACode for Objective-C
params.iataCodeDropoff = "DUB" // use IATACodeDropoff for Objective-C
params.pickupDate = Date(timeIntervalSinceNow: 86400) // next day
params.dropOffDate = Date(timeIntervalSinceNow: 86400 * 3) // next day + 3 days
params.numberOfVehicles = 20
params.sortType = .recommended
params.pickupLocationCoordinate = CLLocationCoordinate2DMake(53.3333, -6.2408989)
params.dropOffLocationCoordinate = CLLocationCoordinate2DMake(51.903614, -8.468399)

Pick Up & Drop Off Location parameters

Pick up location can be passed as a IATA, coordinates or OTA Location ID. Priority is IATA > OTA location id > coordinates

  • ‘pickupLocation’ and ‘dropOffLocation’: It takes a three-letter code that represents airports worldwide. E.g ‘DUB’ for Dublin.

  • ‘pickupLocationCoordinate’s and ‘dropOffLocationCoordinate’:
    context.pickupLocationCoordinate = CLLocationCoordinate2DMake(53.3333, -6.2408989)
    context.dropOffLocationCoordinate = CLLocationCoordinate2DMake(51.903614, -8.468399)
    
  • ‘pickupLocationId’ and ‘dropOffLocationId’: It takes a string OTA Location ID for pickup location, e.g “11” for Dublin.

Property Descriptions

delegate
A CarTrawlerSDKDelegate to receive the API response.
clientID
Your client ID, required to use the CarTrawler API.
countryCode
A country code, such as "US". Default is the device location if not provided.
currencyCode
An optional currency code, based on the ISO standard currency codes e.g "USD". The currency associated with the device’s system region is used by default.
languageCode
A language code. The language associated with the device’s system region is used by default.
pickupDate
[Required] A pick-up Date.
dropOffDate
[Required] A Drop-off Date.
IATACode
An IATA code for pick-up location.
IATACodeDropoff
An IATA code for drop-off location.
pickupLocationID
An OTA Location ID for pick-up location.
dropOffLocationID
An OTA Location ID for drop-off location.
pickupLocationCoordinate
A CLLocationCoordinate2D for pick-up coordinates.
dropOffLocationCoordinate
A CLLocationCoordinate2D for drop-off coordinates. Fallback to pickupLocationCoordinate if is not set.
passengers
An Array of Passengers, the first one will be the main passenger.
numberOfVehicles
A number of vehicles to return, used in the Vehicles API
sortType
The sort type, used in the Vehicles API