Headlight API: Optimize Daily Routes

Comments Comments Off by MobileIQ on June 8, 2012

Here’s a quick tutorial for using the Headlight API to optimize daily routes and create an output file. It’s a convenient way to automate the process of optimizing routes every day. Route optimization jobs can be scheduled to run after hours with the results ready for review in the morning. Since the the information is sent back in a standard format, the billing system even can be updated before generating route itinerary reports or uploading data to handheld devices.
ZZ46C7E83A

Usage

http://applications.gomobileiq.com/routes/optimize?{user_specified_parameters}

Parameters

API_token = unique for every Headlight account
query_date = scheduled delivery or service date in mm/dd/yyyy format
output_filename = output file will be saved to the Headlight Dropbox

OPTIONAL PARAMETERS
sequence_start = first stop number
sequence_increment = stop number increment
fmt = V5 (default) returns a file compatible with the Smart Sync upload specifications
fmt = basic returns a simplified file format
optimize=1 (default) returns optimized routes
optimize=0 returns the current routes without any optimization

Note: Parameters are separated by an ‘&’ character without any spaces.

Usage

Here’s an example URL that will optimize routes using the following options:

  • route all deliveries or service calls scheduled for April 17, 2012
  • 1st scheduled delivery will be Stop #10
  • additional deliveries will be Stop #20, Stop #30, Stop #40 …
  • results will be saved to a file in the Headlight Dropbox
  • filename will be ‘04_17_2012_optimized_routes.csv”

http://applications.gomobileiq.com/routes/optimize?token=abc123&date=4/17/2012&filename=04_17_2012_optimized_routes.csv&seq_start=10&seq_increment=10

Here’s an example URL that will retrieve manual changes to the routes:
http://applications.gomobileiq.com/routes/optimize?token=abc123&date=4/17/2012&filename=04_17_2012_optimized_routes.csv&optimize=0

Example using PHP and cURL

$data = array();
$data['token'] = ‘abc123′;
$data['date'] = ‘4/17/2012′;
$data['filename'] = ‘04_17_2012_optimized_routes.csv’;
$data['seq_start'] = 10;
$data['seq_increment'] = 10;

$handle = curl_init(’applications.gomobileiq.com/routes/optimize’);
curl_setopt($handle, CURLOPT_POST, true);
curl_setopt($handle, CURLOPT_POSTFIELDS, $data);
curl_exec($handle);

Tags:

Comments are closed.