Add Multimedia Content to a Route Destination
See files for this Use Case on GitHub here
You can add a file with multimedia content as a note to any route destination. For more detailed instructions, go to the support portal in Route4Me's official web application (see link )
Description
It's useful to have the ability to attach a file with multimedia content to a route destination. A picture of a particular building or entrance may help users find their destinations faster.
You can only use files with the following extensions: CSV, XLS, PDF, JPG, JPEG, GIF, PNG, DOC, DOCX. For other file types, you should be able to insert it into a Word file and use that.
Solution
Optimization Parameters and addresses
Let's choose a Single Driver Round Trip option for this Use Case. Here are the parameters for this optimization:
Parameter | Type | Description | HTTP method |
---|---|---|---|
api_key | string | API KEY of the user | GET |
redirect | integer | If equal to 1, will be redirected, if 0 - not | GET |
addresses | array | Valid JSON array of Address objects. Click here to see the JSON Schema | POST |
parameters | Route Parameters | Valid JSON string of RouteParameters object. Click here to see the JSON Schema | POST |
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:
- the endpoint for this task is: https://www.route4me.com/api.v4/optimization_problem.php
- input data is stored in the file single_driver_round_trip_data.json
Parameter | Type | Description |
---|---|---|
api_key | string | API KEY of the user |
input data | POST data | Valid JSON object string. Click here to see the JSON Schema |
You can expect an Optimization Problem (see link), which has generated a route already.
View the Optimization details
You can get more details from the newly created Optimization Problem.
The endpoint: https://www.route4me.com/api.v4/optimization_problem.php
HTTP Parameters
Attribute | Type | Description | HTTP method |
---|---|---|---|
api_key | string | API KEY of the user | GET |
optimization_problem_id | string | Optimization problem ID | GET |
See sample RESPONSE JSON data here
In the RESPONSE you can see an array of the addresses, which belong to one round trip route.
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
Attribute | Type | Description | HTTP method |
---|---|---|---|
api_key | string | API KEY of the user | GET |
route_id | string | Route ID | GET |
route_path_output | string | If equal to 'Poitns', you'll get an array of the path points to next address | GET |
See sample RESPONSE JSON data here
- Note
- In the RESPONSE you can see the array of the fields path_to_next and use them to draw routes on a map, exactly as they were generated by the Route4Me API.
You can draw the generated round trip route as:

Compare it to the drawing of the official Route4Me website:

Add a note to a destination
You can add a file to any route destination.
The endpoint: https://www.route4me.com/actions/addRouteNotes.php
HTTP Parameters (see JSON schema here)
Attribute | Type | Description | HTTP method |
---|---|---|---|
api_key | string | API KEY of the user | GET |
route_id | string | Route ID | GET |
address_id | intenger | Route destination ID | GET |
dev_lat | double | The latitude location of where a mobile device was located when it made a request | GET |
dev_lng | double | The longitude location of where a mobile device was located when it made a request | GET |
device_type | string | The type of the device that is creating this route ENUM("web", "iphone", "ipad", "android_phone", "android_tablet") | GET |
strUpdateType | string | The type of the device that is creating this route ENUM("web", "iphone", "ipad", "android_phone", "android_tablet") | GET |
strFilename | string | Filename ID | POST |
Run this batch script with the cURL command:
You'll get this API response:
Pay attention to the upload_url parameter. You can enter it in the browser's address bar and see the content of the file directly in your browser.
Also, it's noteworthy that in the strUpdateType parameter we have put the value ANY_FILE, but in response we get ADDRESS_IMG - that's the right value for this particular Use Case example.
Retrieve information about uploaded note file.
As mentioned above, you can see the uploaded file directly in a browser by entering the upload_url parameter value into the browser's address field.
But you can also retrieve information about the uploaded file programmatically.
The endpoint: https://www.route4me.com/api.v4/address.php
HTTP Parameters
Attribute | Type | Description | HTTP method |
---|---|---|---|
api_key | string | API KEY of the user | GET |
route_id | string | Route ID | GET |
route_destination_id | intenger | Route destination ID | GET |
notes | integer | If equal to 1, response with notes will be returned, if not - without notes. | GET |
Run this batch script:
See sample RESPONSE JSON data here
Pay attention to the notes parameter.
You can show a note on the map at the destination with:

And by clicking on the marker, you can show the image in the browser. Tip: If you are using GMap.net control, you can save the upload_url value in the tag property and in the OnMarkerClick event handler launch browser with this URL address.