Get full details for a given location as defined by the Place ID. The result may be a Point of Interest (POI), such as an airport or train station. In this case, the results will also show the details of the POI and any special meeting instructions (such as parking restrictions or Meet and Greet).
locationInfo(locationInfoRequest: LocationInfoRequest) : Call<LocationInfo>
sessionToken
inside LocationInfoRequest
indicates the session for requests. Many requests can be made with the same session token.
Parameters
locationInfoRequest
: LocationInfoRequest
Returns
Call
<LocationInfo>
Errors
Examples
iOS
let addressService = Karhoo.getAddressService()
let placeId = "SOME_PLACE_ID"
let sessionToken = "SOME_SESSION_TOKEN"
let locationInfoRequest = LocationInfoRequest(placeId: placeId, sessionToken: sessionToken)
addressService.locationInfo(locationInfoRequest: locationInfoRequest).execute { result in
switch result {
case .success(let locationInfo):
print("LocationInfo: \(locationInfo)")
case .failure(let error):
print("error: \(error.code) \(error.message)")
}
}
Android
val addressService = KarhooApi.addressService
val placeId = "SOME_PLACE_ID"
val sessionToken = "SOME_SESSION_TOKEN"
val locationInfoRequest = LocationInfoRequest(placeId, sessionToken)
addressService.locationInfo(locationInfoRequest).execute { result ->
when (result) {
is Resource.Success -> print(result.data) // Handle data
is Resource.Failure -> print(result.error.internalMessage) //Handle errors
}
}