Overview

The Hailo API lets you integrate Hailo into your own application. It is a HTTP-based JSON API, accessible at https://api.hailoapp.com/

Base URL

All endpoints in the documentation starts with the following URL:

https://api.hailoapp.com


Authentication

The following authentication method is supported:
TypeNameDescriptionDetails
API KeyDefaultDefault Authentication

Pass As: URL Query String
Keyname: api_token

Installation Guide

The API client (SDK) and sample code for this programming langauge is still in Beta. Please kindly report any issue/feedback to support@restunited.com

Download and install
Please follow the instruction below to download the tarball, then includes the files in the project' }

wget http://files1.restunited.com/libraries/api_hailoapp_com_005648/dev/0/0/4/sw/Hailo-dev-0.0.4-flash.tar.gz
tar mzxvf Hailo-dev-0.0.4-flash.tar.gz
mv Hailo-flash /path/to/your/project/libs/

Import the library
Please refer to this tutorial for detailed instructions.

The API client (SDK) and sample code for this programming langauge is still in Beta. Please kindly report any issue/feedback to support@restunited.com

Download and install
Please follow the instruction below to download the tarball, then build and install the libraries using Maven

wget http://files1.restunited.com/libraries/api_hailoapp_com_005648/dev/0/0/4/sw/Hailo-dev-0.0.4-android_java.tar.gz
tar mzxvf Hailo-dev-0.0.4-android_java.tar.gz
cd Hailo-android_java
mvn package

Copy the JARs to your Android App project folder

cp target/lib/httpclient* YOUR_PROJECT/libs/
cp target/lib/jackson* YOUR_PROJECT/libs/
cp target/Hailo-0.0.4.jar YOUR_PROJECT/libs/
You may also need to add the above JARs to your build path. Please refer to the instructions here.

Import the packages

import com.hailoapp.api.client.*;
import com.hailoapp.api.hailo.api.*;
import com.hailoapp.api.hailo.model.*;

The API client (SDK) and sample code for this programming langauge is still in Beta. Please kindly report any issue/feedback to support@restunited.com

Download and Install
Please follow the instruction below to download the tarball and move the folder to the 'lib' folder in the project.

wget http://files1.restunited.com/libraries/api_hailoapp_com_005648/dev/0/0/4/sw/Hailo-dev-0.0.4-csharp.tar.gz
tar mzxvf Hailo-dev-0.0.4-csharp.tar.gz
mv Hailo-csharp /path/to/your/project/lib/

Add the library to the project in the IDE

  1. Open or create a C# application using your favorite IDE
  2. Add the folder Hailo-csharp to the project
  3. Add System.Web and Hailo-csharp/bin/Newtonsoft.Json.dll to the project's "References"

Import the following

using com.hailoapp.api.Hailo.Api;
using com.hailoapp.api.Hailo.Model;
Please kindly ignore the warnings for the time being while we're improving the generated SDK for C#

Download and install
Please follow the instruction below to download the tarball, then build and install the Java JAR using Maven

wget http://files1.restunited.com/libraries/api_hailoapp_com_005648/dev/0/0/4/sw/Hailo-dev-0.0.4-java.tar.gz
tar mzxvf Hailo-dev-0.0.4-java.tar.gz
cd Hailo-java
mvn package
mvn install

Update pom.xml

<dependency>
    <groupId>com.hailoapp.api</groupId>
    <artifactId>Hailo</artifactId>
    <version>0.0.4</version>
    <scope>compile</scope>
</dependency>

Import the packages

import com.hailoapp.api.client.*;
import com.hailoapp.api.hailo.api.*;
import com.hailoapp.api.hailo.model.*;

The API client (SDK) and sample code for this programming langauge is still in Beta. Please kindly report any issue/feedback to support@restunited.com

Download and install
Please follow the instruction below to download the tarball and then install the Objective C library

wget http://files1.restunited.com/libraries/api_hailoapp_com_005648/dev/0/0/4/sw/Hailo-dev-0.0.4-objc.tar.gz
tar mzxvf Hailo-dev-0.0.4-objc.tar.gz
cd Hailo-objc
pod install

Add HailoClient.xcodeproj to XCode

  1. Add HailoClient.xcodeproj to your Mac project (from Xcode menu Project > Add to Project...)
  2. On your app target, open the info window (using Get Info on the target), then in the General tab, add HailoClient (framework) to Direct Dependencies
  3. Add a new Copy Files phase, and choose Framework for the Destination (in its own info window)
  4. Drag HailoClient.framework from the Groups & Files panel in Xcode (under the added HailoClient.xcodeproj) to the newly created Copy Files phase
  5. Drag HailoClient.framework once again to the target's Linked Binary With Libraries group
  6. Open the Info window of your target again. Set Configuration to All Configurations, then in the Framework Search Paths property, add $(TARGET_BUILD_DIR)/$(FRAMEWORKS_FOLDER_PATH)

Import the following

#import <SWGApiClient.h>
// load models (responses) defined for endpoints
#import <Drivers.h>
#import <Driver.h>
#import <Etas.h>
#import <Eta.h>
// load classes for accessing the endpoints
#import <SWGDriversApi.h>

Download and install
Please follow the instruction below to download the tarball and then install the PHP libraries

wget http://files1.restunited.com/libraries/api_hailoapp_com_005648/dev/0/0/4/sw/Hailo-dev-0.0.4-php.tar.gz
tar mzxvf Hailo-dev-0.0.4-php.tar.gz
mv Hailo-php /path/to/project/directory/

Install php5-curl package

sudo apt-get install php5-curl

Add the following in the code

<?php
require_once 'Hailo-php/Hailo.php';
?>

Download and install
Please follow the instruction below to download the tarball and then install the Python modules

wget http://files1.restunited.com/libraries/api_hailoapp_com_005648/dev/0/0/4/sw/Hailo-dev-0.0.4-python.tar.gz
tar mzxvf Hailo-dev-0.0.4-python.tar.gz
cd Hailo-python
python setup.py install --user    # for current user
sudo python setup.py install      # for all user

Add the following in the code

import urllib2
import Hailo
from pprint import pprint

Download
Please follow the instruction below to download the tarball

wget http://files1.restunited.com/libraries/api_hailoapp_com_005648/dev/0/0/4/sw/Hailo-dev-0.0.4-ruby.tar.gz
tar mzxvf Hailo-dev-0.0.4-ruby.tar.gz

Install
The generated SDK can be built and installed as a Ruby gem

cd Hailo-ruby
gem build Hailo.gemspec
gem install ./Hailo-0.0.4.gem

Then include the following in the Gemfile and run bundle install

gem "Hailo", "~> 0.0.4"

Or directly "require" the gem in the code

require 'Hailo'

Configuration
Initialize Swagger configraiton before calling any API methods

Hailo::Swagger.configure do |config|
  config.scheme = 'https'
  config.host = 'api.hailoapp.com'
  config.base_path = ''
  config.inject_format = false
end

The API client (SDK) and sample code for this programming langauge is still in Beta. Please kindly report any issue/feedback to support@restunited.com

Download and install
Please follow the instruction below to download the tarball, then build and install using Maven

wget http://files1.restunited.com/libraries/api_hailoapp_com_005648/dev/0/0/4/sw/Hailo-dev-0.0.4-scala.tar.gz
tar mzxvf Hailo-dev-0.0.4-scala.tar.gz
cd Hailo-scala
mvn package
mvn install

Update pom.xml

<dependency>
    <groupId>com.hailoapp.api</groupId>
    <artifactId>Hailo</artifactId>
    <version>0.0.4</version>
    <scope>compile</scope>
</dependency>

Import the packages

import com.hailoapp.api.client._;
import com.hailoapp.api.hailo.api._;
import com.hailoapp.api.hailo.model._;

Download and install

Please follow the instructions here to download and install Unirest for Java.

Download and install

Please follow the instructions here to download and install Unirest for Node.js.

Download and install

Please follow the instructions here to download and install Unirest for Objective-C.

Download and install

Please follow the instructions here to download and install Unirest for PHP.

Download and install

Please follow the instructions here to download and install Unirest for Python.

Download and install

Please follow the instructions here to download and install Unirest for Ruby.

Download and install

Please follow the instructions here to download and install Unirest for .Net.

Resources

eta
The ETA endpoint allows you to retrieve an Estimated Time of Arrival for cabs near to a location.

GET https://api.hailoapp.com/drivers/eta

The ETA endpoint allows you to retrieve an Estimated Time of Arrival for cabs near to a location.

Parameter

NameTypeLocationDescription
api_tokenStringURL query string

API key or token for authorization

Response

This endpoint returns Eta (model)

Sample response

{
  "etas": [
    {
      "eta": 6,
      "count": 3,
      "service_type": "regular"
    },
    {
      "eta": 6,
      "count": 3,
      "service_type": "executive"
    }
  ]
}


Sample Code

try
{
    var driversApi: DriversApi = new DriversApi();
    var response: Eta = driversApi.eta("sample_api_token");
}
catch (e:Error)
{
  trace(e)
}
/** generated by http://restunited.com */
/** for any feedback/issue with the code, please send to support{at}restunited.com */
try {
    DriversApi driversApi = new DriversApi();
    Eta response = driversApi.eta("sample_api_token");
    System.out.println(response);
} catch (ApiException e) {
    System.out.printf("ApiException caught: %s\n", e.getMessage());
}
curl --get --include "https://api.hailoapp.com/drivers/eta?api_token=<api_token>"
// generated by http://restunited.com
// for any feedback/issue with the code, please send to support{at}restunited.com
try
{
    DriversApi driversApi = new DriversApi();
    Eta response = driversApi.eta("sample_api_token");
}
catch(Exception ex)
{
  Console.WriteLine(ex.ToString());
}
// generated by http://restunited.com
// for any feedback/issue with the code, please send to support{at}restunited.com
try {
    DriversApi driversApi = new DriversApi();
    Eta response = driversApi.eta("sample_api_token");
    System.out.println(response);
} catch (ApiException e) {
    System.out.printf("ApiException caught: %s\n", e.getMessage());
}
// generated by http://restunited.com
// for any feedback/issue with the code, please send to support{at}restunited.com
@try
{
    SWGDriversApi *driversApi = [[SWGDriversApi alloc] init];
    Eta *response = [driversApi etaWithCompletionBlock:@"sample_api_token"];
}
@catch (NSException *exception)
{
  NSLog(@"%@ ",exception.name);
  NSLog(@"Reason: %@ ",exception.reason);
}
// generated by http://restunited.com
// for any feedback/issue with the code, please send to support{at}restunited.com
// setup authentication
$api_token = 'YOUR_API_KEY';

try{
    $apiClient = new Hailo\APIClient('https://api.hailoapp.com');
    $drivers_api = new Hailo\DriversAPI($apiClient);
    $response = $drivers_api->eta($api_token);
    var_dump($response);
} catch (Exception $e) {
    echo 'Caught exception: ', $e->getMessage(), "\n";
}
# generated by http://restunited.com
# for any feedback/issue with the code, please send to support{at}restunited.com
try:
    api_client = Hailo.swagger.ApiClient(api_server="https://api.hailoapp.com")
    drivers_api = Hailo.DriversApi(api_client)
    response = drivers_api.eta("sample_api_token")    
    if isinstance(response, list):
        map(lambda p: pprint(vars(p)), response)
    else:
        pprint(vars(response))

except Exception, e:
    print(e)
# generated by http://restunited.com
# for any feedback/issue with the code, please send to support{at}restunited.com
# setup authentication
api_token = 'YOUR_API_KEY'

begin
  response = Hailo::DriversAPI.eta(api_token)
  p response
rescue StandardError => e
  puts "caught error: #{e}"
end
/** generated by http://restunited.com */
/** for any feedback/issue with the code, please send to support{at}restunited.com */
try {
    val driversApi = new DriversApi
    var response = driversApi.eta("sample_api_token")
} catch {
    case e: Exception => println("exception caught: " + e);
}
HttpResponse<String> response = Unirest.get("https://api.hailoapp.com/drivers/eta?api_token=<api_token>")
.asString();

// HTTP status code
int code = response.getCode();
// Headers
Map<String, String> headers = response.getHeaders();
// Parsed body
String body = response.getBody();
// Unparsed body
InputStream rawBody = response.getRawBody();
unirest.get("https://api.hailoapp.com/drivers/eta?api_token=<api_token>")
.end(function (response) {
  // HTTP status code
  var code = response.code;
  // Headers
  var headers = response.headers;
  // Parsed body
  var body = response.body;
  // Unparsed body
  var raw_body = response.raw_body;
});
UNIUrlConnection *asyncConnection = [[UNIRest get:^(UNISimpleRequest *request) {
  [request setUrl:@"https://api.hailoapp.com/drivers/eta?api_token=<api_token>"];
}] asJsonAsync:^(UNIHTTPJsonResponse *response, NSError *error) {
  // HTTP status code
  NSInteger code = response.code;
  // Headers
  NSDictionary *responseHeaders = response.headers;
  // Parsed body
  UNIJsonNode *body = response.body;
  // Unparsed body
  NSData *rawBody = response.rawBody;
}];
$response = Unirest::get(
  "https://api.hailoapp.com/drivers/eta?api_token=<api_token>",
  null,
  null
);

$response->code; // HTTP status code
$response->headers; // Headers
$response->body; // Parsed body
$response->raw_body; // Unparsed body
response = unirest.get("https://api.hailoapp.com/drivers/eta?api_token=<api_token>")

response.code # HTTP status code
response.headers # The HTTP headers
response.body # The parsed response
response.raw_body # The unparsed response
response = Unirest.get(
  "https://api.hailoapp.com/drivers/eta?api_token=<api_token>",
  headers: {},
  parameters: {}
)

response.code # Status code
response.headers # Response headers
response.body # Parsed body
response.raw_body # Unparsed body
HttpResponse<MyClass> response = Unirest.get("https://api.hailoapp.com/drivers/eta?api_token=<api_token>")
.asString<MyClass>();

response.Code; // HTTP status code
response.Headers; // Headers
response.Body; // Parsed body
response.Raw; // Unparsed body

Error

Error CodeMessage
400Bad request
401Unauthorized
403Forbidden
404Resource not found
502Bad gateway
503Service Unavailable

near
Take users directly from your app into the Hailo app's confirm screen, with pickup and destination information pre-filled

GET https://api.hailoapp.com/drivers/near

Take users directly from your app into the Hailo app's confirm screen, with pickup and destination information pre-filled. Both the iOS and Android apps can be launched by invoking hailoapp://confirm, and both accept the same parameters. Note: To ensure a seamless user experience, please check there are drivers nearby with a call to the ETA endpoint before sending them to the Hailo app.

Parameter

NameTypeLocationDescription
api_tokenStringURL query string

API key or token for authorization

Response

This endpoint returns Driver (model)

Sample response

{
  "drivers": [
    {
      "latitude": 51.50808,
      "longitude": -0.116408,
      "service_type": "regular"
    },
    {
      "latitude": 51.504695,
      "longitude": -0.113202,
      "service_type": "regular"
    },
    {
      "latitude": 51.51135,
      "longitude": -0.127148,
      "service_type": "regular"
    },
    {
      "latitude": 51.511745,
      "longitude": -0.117742,
      "service_type": "regular"
    },
    {
      "latitude": 51.509996,
      "longitude": -0.118696,
      "service_type": "regular"
    }
  ]
}


Sample Code

try
{
    var driversApi: DriversApi = new DriversApi();
    var response: Driver = driversApi.near("sample_api_token");
}
catch (e:Error)
{
  trace(e)
}
/** generated by http://restunited.com */
/** for any feedback/issue with the code, please send to support{at}restunited.com */
try {
    DriversApi driversApi = new DriversApi();
    Driver response = driversApi.near("sample_api_token");
    System.out.println(response);
} catch (ApiException e) {
    System.out.printf("ApiException caught: %s\n", e.getMessage());
}
curl --get --include "https://api.hailoapp.com/drivers/near?api_token=<api_token>"
// generated by http://restunited.com
// for any feedback/issue with the code, please send to support{at}restunited.com
try
{
    DriversApi driversApi = new DriversApi();
    Driver response = driversApi.near("sample_api_token");
}
catch(Exception ex)
{
  Console.WriteLine(ex.ToString());
}
// generated by http://restunited.com
// for any feedback/issue with the code, please send to support{at}restunited.com
try {
    DriversApi driversApi = new DriversApi();
    Driver response = driversApi.near("sample_api_token");
    System.out.println(response);
} catch (ApiException e) {
    System.out.printf("ApiException caught: %s\n", e.getMessage());
}
// generated by http://restunited.com
// for any feedback/issue with the code, please send to support{at}restunited.com
@try
{
    SWGDriversApi *driversApi = [[SWGDriversApi alloc] init];
    Driver *response = [driversApi nearWithCompletionBlock:@"sample_api_token"];
}
@catch (NSException *exception)
{
  NSLog(@"%@ ",exception.name);
  NSLog(@"Reason: %@ ",exception.reason);
}
// generated by http://restunited.com
// for any feedback/issue with the code, please send to support{at}restunited.com
// setup authentication
$api_token = 'YOUR_API_KEY';

try{
    $apiClient = new Hailo\APIClient('https://api.hailoapp.com');
    $drivers_api = new Hailo\DriversAPI($apiClient);
    $response = $drivers_api->near($api_token);
    var_dump($response);
} catch (Exception $e) {
    echo 'Caught exception: ', $e->getMessage(), "\n";
}
# generated by http://restunited.com
# for any feedback/issue with the code, please send to support{at}restunited.com
try:
    api_client = Hailo.swagger.ApiClient(api_server="https://api.hailoapp.com")
    drivers_api = Hailo.DriversApi(api_client)
    response = drivers_api.near("sample_api_token")    
    if isinstance(response, list):
        map(lambda p: pprint(vars(p)), response)
    else:
        pprint(vars(response))

except Exception, e:
    print(e)
# generated by http://restunited.com
# for any feedback/issue with the code, please send to support{at}restunited.com
# setup authentication
api_token = 'YOUR_API_KEY'

begin
  response = Hailo::DriversAPI.near(api_token)
  p response
rescue StandardError => e
  puts "caught error: #{e}"
end
/** generated by http://restunited.com */
/** for any feedback/issue with the code, please send to support{at}restunited.com */
try {
    val driversApi = new DriversApi
    var response = driversApi.near("sample_api_token")
} catch {
    case e: Exception => println("exception caught: " + e);
}
HttpResponse<String> response = Unirest.get("https://api.hailoapp.com/drivers/near?api_token=<api_token>")
.asString();

// HTTP status code
int code = response.getCode();
// Headers
Map<String, String> headers = response.getHeaders();
// Parsed body
String body = response.getBody();
// Unparsed body
InputStream rawBody = response.getRawBody();
unirest.get("https://api.hailoapp.com/drivers/near?api_token=<api_token>")
.end(function (response) {
  // HTTP status code
  var code = response.code;
  // Headers
  var headers = response.headers;
  // Parsed body
  var body = response.body;
  // Unparsed body
  var raw_body = response.raw_body;
});
UNIUrlConnection *asyncConnection = [[UNIRest get:^(UNISimpleRequest *request) {
  [request setUrl:@"https://api.hailoapp.com/drivers/near?api_token=<api_token>"];
}] asJsonAsync:^(UNIHTTPJsonResponse *response, NSError *error) {
  // HTTP status code
  NSInteger code = response.code;
  // Headers
  NSDictionary *responseHeaders = response.headers;
  // Parsed body
  UNIJsonNode *body = response.body;
  // Unparsed body
  NSData *rawBody = response.rawBody;
}];
$response = Unirest::get(
  "https://api.hailoapp.com/drivers/near?api_token=<api_token>",
  null,
  null
);

$response->code; // HTTP status code
$response->headers; // Headers
$response->body; // Parsed body
$response->raw_body; // Unparsed body
response = unirest.get("https://api.hailoapp.com/drivers/near?api_token=<api_token>")

response.code # HTTP status code
response.headers # The HTTP headers
response.body # The parsed response
response.raw_body # The unparsed response
response = Unirest.get(
  "https://api.hailoapp.com/drivers/near?api_token=<api_token>",
  headers: {},
  parameters: {}
)

response.code # Status code
response.headers # Response headers
response.body # Parsed body
response.raw_body # Unparsed body
HttpResponse<MyClass> response = Unirest.get("https://api.hailoapp.com/drivers/near?api_token=<api_token>")
.asString<MyClass>();

response.Code; // HTTP status code
response.Headers; // Headers
response.Body; // Parsed body
response.Raw; // Unparsed body

Error

Error CodeMessage
400Bad request
401Unauthorized
403Forbidden
404Resource not found
502Bad gateway
503Service Unavailable

Response Model
Model defines for REST API clients (SDKs)

Driver

NameTypeDescription
driversArray of Drivers (model)

Drivers

Example:

Drivers

NameTypeDescription
latitudeNumber

Latitude

Example: 51.50808

longitudeNumber

Longitude

Example: -0.116408

service_typeString

Service type

Example: regular

Eta

NameTypeDescription
etasArray of Etas (model)

Etas

Example:

Etas

NameTypeDescription
countInteger

Count

Example: 3

etaInteger

Eta

Example: 6

service_typeString

Service type

Example: regular

Empty
This indciates the endpoint does not return any data in the HTTP Respone body. It simply relies on HTTP status code (e.g. 200) to indicate if the request is successful.

Terms & Conditions

No Terms of Conditions defined

Contact

Please contact api@hailocab.com for questions or feedbacks