Access Route4Me's logistics-as-a-service API using our VB.NET SDK
In layman's terms Route4Me solves complex variations of the traveling salesman problem and the vehicle routing problem. In more technical terms, Route4Me solves HP-hard logistics problems that span several mathematical and scientific disciplines such as industrial engineering, operations research, algorithmic graph theory, computational geometry, combinatorial optimization, fleet management, field service management, telematics.
This SDK makes it easier for you use the Route4Me API. The API has many features, including route optimization, and the primary features are related to creating orders and then creating optimally sequenced driving routes for many drivers.
The service is typically used by organizations who must route many drivers to many destinations. In addition to route optimization for new (future) routes, the API can also be used to analyze historical routes, and to distribute routes to field personnel.
The Route4Me SDK and API cannot be resold or used in a product or system that competes directly with Route4Me. This means that developers cannot resell route optimization services to other businesses or developers. However, developers can integrate our route optimization SDK/API into their software applications. Developers and startups are also permitted to use our software for internal purposes (i.e. a same day delivery startup).
A Route4Me customer, integrator, or partner incorporates the Route4Me SDK or API into their code base. Route4Me permits any paying subscriber to interact with every part of its system using it’s API. The API is RESTful, which means that it’s web based and can be accessed by other programs and machines The API/SDK should be used to automate the route planning process, or to generate many routes with minimal manual intervention
Every Route4Me SDK instance needs a unique API key. The API key can be retrieved inside your Route4Me.com account, inside the Settings tab called API. When a route is planned, it appears inside the corresponding Route4Me account. Because Route4Me web and mobile accounts are synchronized, the routes will appear in both environments at the same time.
No. The sample API key only permits you to optimize routes with the sample address coordinates that are part of this SDK.
The number of requests you can make per second is limited by your current subscription plan. Typically, there are different rate limits for these core features: Address Geocoding & Address Reverse Geocoding Route Optimization & Management Viewing a Route
There are two typical integration strategies that we recommend. Using this SDK, you can make optimization requests and then the SDK polls the Route4Me API to detect state changes as the optimization progresses. Alternatively, you can provide a webhook/callback url, and the API will notify that callback URL every time there is a state change.
I don't need route management or mobile capabilities. Can I just use the route planning and route optimization API?
There are no additional costs to use the web interface or the mobile application to view your optimized routes, which mean that you can use only the API without paying extra for our web app or mobile app.
Most routes having less than 200 destinations are optimized in 1 second or less. Larger routes having thousands of stops are split into their most reasonably optimal geographical regions, and then each of those regions is independently optimized in parallel. Whether you use polling or push, you will be able to retrieve all the routes optimized that were created from a large optimization problem set.
Yes. You can send routes with optimization disabled if you want to conveniently see them on a map, or distribute them to your drivers in the order you prefer.
Yes. The API can accept lat/lng and an unlimited amount metadata per destination (e.g. altitude, weight, pieces, cubic dimension). The metadata will be preserved as passthrough data by our API, so that the receiving service or device will have access to critical data when our API invokes a webhook callback to the device.
Yes. Unless your contract specificies otherwise, all routes are permanently stored in the database and are no longer accessible to you after your subscription is terminated. Route4Me auto-prunes route data based on your subscription plan, with more expensive plans typically permitting a longer archival period.
Can I incorporate your API into my mobile application that requires routing, navigation, or route planning?
Route4Me's route planning and optimization technology can only be added into applications that do not directly compete with Route4Me. This means the application’s primary capabilities must be unrelated to route optimization, route planning, or navigation.
Yes
White-labeling and private-labeling Route4Me is possible but the deal's licensing terms vary considerably based on customer count, route count, and the level of support that Route4Me should provide to your customers.
Yes
Can the API/SDK send notifications back to our system using callbacks, notifications, pushes, or webhooks?
Because Route4Me processes all routes asynchronously, Route4Me will immediately notify the endpoint you specify as a route optimization job progresses through each state of the optimization. Every stage of the route optimization process has a unique stage id.
Route4Me.com, as well as all of Route4Me’s mobile applications use the Route4Me SDK’s and API. Since Route4Me works globally, this means that all of Route4Me’s capabilities are available using the SDK’s in almost every country that has well digitized maps.
Customers are encouraged to select their preferred operating system environment. The Route4Me API/SDK will function on any operating system that supports the preferred programming language of the customer. At this point in time, almost every supported SDK can run on any operating system.
Route4Me has its own computing infrastructure that you can access using the API and SDKs. Customers typically have to run the SDK code on their own computers and/or servers to access this infrastructure.
Route4Me does not currently lease or sell servers, and does not have on-premise appliance solution. This would only be possible in exceptionally unique scenarios.
The time required to integrate the SDK can be as little as 1 hour or may take several weeks, depending on the number of features being incorporated into the customer’s application and how much integration testing will be done by the client. A programmer’s involvement is almost always required to use Route4Me’s technology when accessing it through the API.
- Add reference to Route4MeSDKLibrary.dll
- Use the class Route4MeSDK.Route4MeManager for accessing the Route4ME API
- Use methods Route4MeManager.GetRoute(), Route4MeManager.UpdateOptimization() etc. to access the main functionality of Route4Me API.
- Use generic methods Route4MeManager.GetStringResponseFromAPI() and Route4MeManager.GetJsonObjectFromAPI() for accessing any Route4Me API functionally via custom defined classes (see example in Route4MeSDKTest.SingleDriverRoundTripGeneric.cs)
- See project "Route4Me Route Optimization Examples" (class Route4MeSDKTest.Examples) for some examples of using Route4MeSDKLibrary
- See an example of creating a simple route below
Imports Route4MeSDKLibrary.Route4MeSDK
Imports Route4MeSDKLibrary.Route4MeSDK.DataTypes
Imports Route4MeSDKLibrary.Route4MeSDK.QueryTypes
Namespace Route4MeSDKTest.Examples
Partial Public NotInheritable Class Route4MeExamples
Public Function SingleDriverRoundTrip() As DataObject
' Create the manager with the api key
Dim route4Me As New Route4MeManager(c_ApiKey)
' Prepare the addresses
'#Region "Addresses" ' Note: For vb.net code region feature is supported starting from Visual Studio 2015
Dim addresses As Address() = New Address() {New Address() With { _
.AddressString = "754 5th Ave New York, NY 10019", _
.[Alias] = "Bergdorf Goodman", _
.IsDepot = True, _
.Latitude = 40.7636197, _
.Longitude = -73.9744388, _
.Time = 0 _
}, New Address() With { _
.AddressString = "717 5th Ave New York, NY 10022", _
.[Alias] = "Giorgio Armani", _
.Latitude = 40.7669692, _
.Longitude = -73.9693864, _
.Time = 0 _
}, New Address() With { _
.AddressString = "888 Madison Ave New York, NY 10014", _
.[Alias] = "Ralph Lauren Women's and Home", _
.Latitude = 40.7715154, _
.Longitude = -73.9669241, _
.Time = 0 _
}, New Address() With { _
.AddressString = "1011 Madison Ave New York, NY 10075", _
.[Alias] = "Yigal Azrou'l", _
.Latitude = 40.7772129, _
.Longitude = -73.9669, _
.Time = 0 _
}, New Address() With { _
.AddressString = "440 Columbus Ave New York, NY 10024", _
.[Alias] = "Frank Stella Clothier", _
.Latitude = 40.7808364, _
.Longitude = -73.9732729, _
.Time = 0 _
}, New Address() With { _
.AddressString = "324 Columbus Ave #1 New York, NY 10023", _
.[Alias] = "Liana", _
.Latitude = 40.7803123, _
.Longitude = -73.9793079, _
.Time = 0 _
}, _
New Address() With { _
.AddressString = "110 W End Ave New York, NY 10023", _
.[Alias] = "Toga Bike Shop", _
.Latitude = 40.7753077, _
.Longitude = -73.9861529, _
.Time = 0 _
}, New Address() With { _
.AddressString = "555 W 57th St New York, NY 10019", _
.[Alias] = "BMW of Manhattan", _
.Latitude = 40.7718005, _
.Longitude = -73.9897716, _
.Time = 0 _
}, New Address() With { _
.AddressString = "57 W 57th St New York, NY 10019", _
.[Alias] = "Verizon Wireless", _
.Latitude = 40.7558695, _
.Longitude = -73.9862019, _
.Time = 0 _
}}
'#End Region
' Set parameters
Dim parameters As New RouteParameters() With { _
.AlgorithmType = AlgorithmType.TSP, _
.StoreRoute = False, _
.RouteName = "Single Driver Round Trip", _
.RouteDate = R4MeUtils.ConvertToUnixTimestamp(DateTime.UtcNow.[Date].AddDays(1)), _
.RouteTime = 60 * 60 * 7, _
.RouteMaxDuration = 86400, _
.VehicleCapacity = "1", _
.VehicleMaxDistanceMI = "10000", _
.Optimize = EnumHelper.GetEnumDescription(Optimize.Distance), _
.DistanceUnit = EnumHelper.GetEnumDescription(DistanceUnit.MI), _
.DeviceType = EnumHelper.GetEnumDescription(DeviceType.Web), _
.TravelMode = EnumHelper.GetEnumDescription(TravelMode.Driving) _
}
Dim optimizationParameters As New OptimizationParameters() With { _
.Addresses = addresses, _
.Parameters = parameters _
}
' Run the query
Dim errorString As String = ""
Dim dataObject As DataObject = route4Me.RunOptimization(OptimizationParameters, errorString)
' Output the result
PrintExampleOptimizationResult("SingleDriverRoundTrip", dataObject, errorString)
Return dataObject
End Function
End Class
End Namespace