Retrieve the Last Known Location of All Users

See files for this Use Case on GitHub here

The owners of the Route4Me multi-user accounts can simultaniously track all sub-users on a single map at the same time.

Description

Route4Me users with a team plan or higher, are able to see sub-user's locations on a map with a 60 second delay.

A mobile team member logs in the app with his/her username and password and selects a route. For a selected route the team member's location appears on a map and will refresh every 60 seconds.

Even if the iPhone or iPad app is minimized, Route4Me will still continue submitting the data on current location to the server. On Android version of the app, in case of interrupted internet connection, all the tracking data will be reconciled to the server when an internet connection restored.

Tracking Multiple Users at Route4Me Official Website

You can track multiple drivers simultaneously in the Routes Map section.

Click Routes and select Routes Map.

On the map, click Tracking and select Users.

This will display your drivers' current location.

You can see the information for the driver by hovering the cursor over the driver's icon on the map.

Solution

Optimization Parameters and addresses

Let us choose the Single Driver Round Trip option for this use case. Here are the parameters for this Optimization Problem:

ParameterTypeDescriptionHTTP method
api_keystringAPI KEY of the userGET
redirectintegerIf equal to 1, will be redirected, if 0 - notGET
addressesarrayValid JSON array of Address objects. Click here to see the JSON SchemaPOST
parametersRoute ParametersValid JSON string of RouteParameters object. Click here to see the JSON SchemaPOST

You can see the addresses on the map as:

Create an Optimization

The cURL example below shows you how to create new optimized routes for this Use Case:

ParameterTypeDescription
api_keystringAPI KEY of the user
input dataPOST dataValid JSON object string. Click here to see the JSON Schema
1 @ECHO OFF
2 
3 :: Single Driver Round Trip
4 
5 ::See video tutorial here: http://support.route4me.com/route-planning-help.php?id=manual0:tutorial2:chapter1:subchapter1
6 
7 SET URL=https://www.route4me.com/api.v4/optimization_problem.php
8 SET apikey=11111111111111111111111111111111
9 
10 ECHO ON
11 
12 curl -o file1.txt -g -X POST -k -d "@single_driver_round_trip_data.json" "%URL%?api_key=%apikey%"
13 
14 timeout /t 30

You can expect an Optimization Problem (see link), which has generated a route already.

View the Optimization details

The endpoint: https://www.route4me.com/api.v4/optimization_problem.php

HTTP Parameters

AttributeTypeDescriptionHTTP
method
api_keystringAPI KEY of the userGET
optimization_problem_idstringOptimization problem IDGET


1 @ECHO OFF
2 
3 SET url=https://www.route4me.com/api.v4/optimization_problem.php
4 SET apikey=11111111111111111111111111111111
5 SET optprobid=6906FE9D0B8B4597B280254D56630B5F
6 
7 ECHO ON
8 curl -o file1.txt -g -X GET -k "%URL%?api_key=%apikey%&optimization_problem_id=%optprobid%"
9 
10 timeout /t 30

See sample RESPONSE JSON data here

Details of the Optimized Route

You can get more details of this route.

The endpoint: https://www.route4me.com/api.v4/route.php

HTTP Parameters

AttributeTypeDescriptionHTTP
method
api_keystringAPI KEY of the userGET
route_idstringRoute IDGET
route_path_outputstringIf equal to 'Poitns', you'll get an array of the path points to next addressGET


1 @ECHO OFF
2 
3 SET url=https://www.route4me.com/api.v4/route.php
4 SET apikey=11111111111111111111111111111111
5 SET routeid=9E9F431F3409C88336C228B7BF1CAAFC
6 SET rpo=Points
7 
8 ECHO ON
9 
10 curl -o file1.txt -g -k -X GET "%url%?route_id=%routeid%&api_key=%apikey%&route_path_output=%rpo%"
11 
12 timeout /t 30

See sample RESPONSE JSON data here

Note
System will send a RESPONSE with an array of fields path_to_next.You use those to draw routes on a map, exactly as they were generated the by Route4Me API.

You can draw the generated round trip route as:

Will be finished soon