Web services listing
Web service documentation  -  Distances and Directions  -  Interactive/FreightDirectionsAndLines/v2.00

DistancesAndDirections/Interactive/FreightDirectionsAndLines (v 2.00)

Returns the directions with polylines between two or more points. Allows input of vehicle size parameters to ensure the route avoids restrictions if possible.

REST code samples & end points

We have sample code available for most development environments. Choose a language below and click the button to view the code.

We're more than just a SOAP service. Select an end point below and click the button to view an example.

Try it

Enter your values in the form below to try the service for yourself.

Name Value Type Description Default Example
Start String The coordinates (latitude, longitude or easting, northing) of the start of the route. A postcode is also valid.   381600,259400
Finish String The coordinates (latitude, longitude or easting, northing) of the finish of the route. A postcode is also valid.   380600,258400
WayPoints * Array (comma separated list) of String The coordinates (latitude, longitude or easting, northing) of any waypoints. Postcodes are also valid.   391600,251400
DistanceType * String Specifies how the distances between the stores are calculated. Fastest Fastest
LineStyle * String Specifies the output format for the line. WKTLatLong WKTLatLong
Height * Integer Specifies the height of your vehicle, in centimetres. Please note that bridges over 487cm or 16 feet are not signed on the road and therefore not collected in the data, and so cannot be avoided. 0 280
Weight * Integer Specifies the weight of your vehicle, in kilograms. 0 6500
Width * Integer Specifies the width of your vehicle, in centimetres. 0 220
Length * Integer Specifies the length of your vehicle, in centimetres. 0  
AxleWeight * Integer Specifies the maximum axle weight of your vehicle, in kilograms. 0  
StartDay * String The day of the week the route is to start on. Provide this parameter only if you wish to utilise superior 'Speed Profiles' historic traffic speed data over time for avoiding rush hours and such. NotSupplied Monday
StartTime * String The time of day the route is to start on, measured in whole minutes from midnight. (E.g. 8:30am is entered as 510.) Provide this parameter only if you wish to utilise superior 'Speed Profiles' historic traffic speed data over time for avoiding rush hours and such.   510
   

* Optional - if left blank the default is used.

Parameters

Each request to the web service requires a number of parameters, all of which are listed below. All requests require a key which was generated when you registered. You can create any number of keys, each of which can be reported on individually and have specific security settings.

Name Type Description Default Values Example
Key String The key to use to authenticate to the service.     AA11-AA11-AA11-AA11
Start String The coordinates (latitude, longitude or easting, northing) of the start of the route. A postcode is also valid.     381600,259400
Finish String The coordinates (latitude, longitude or easting, northing) of the finish of the route. A postcode is also valid.     380600,258400
WayPoints * Array of String The coordinates (latitude, longitude or easting, northing) of any waypoints. Postcodes are also valid.     391600,251400
DistanceType * String Specifies how the distances between the stores are calculated. Fastest Fastest | Shortest Fastest
LineStyle * String Specifies the output format for the line. WKTLatLong WKTLatLong | WKTEastNorth | JSLatLong | JSEastNorth | PCACompressable WKTLatLong
Height * Integer Specifies the height of your vehicle, in centimetres. Please note that bridges over 487cm or 16 feet are not signed on the road and therefore not collected in the data, and so cannot be avoided. 0   280
Weight * Integer Specifies the weight of your vehicle, in kilograms. 0   6500
Width * Integer Specifies the width of your vehicle, in centimetres. 0   220
Length * Integer Specifies the length of your vehicle, in centimetres. 0    
AxleWeight * Integer Specifies the maximum axle weight of your vehicle, in kilograms. 0    
StartDay * String The day of the week the route is to start on. Provide this parameter only if you wish to utilise superior 'Speed Profiles' historic traffic speed data over time for avoiding rush hours and such. NotSupplied NotSupplied | Monday | Tuesday | Wednesday | Thursday | Friday | Saturday | Sunday Monday
StartTime * String The time of day the route is to start on, measured in whole minutes from midnight. (E.g. 8:30am is entered as 510.) Provide this parameter only if you wish to utilise superior 'Speed Profiles' historic traffic speed data over time for avoiding rush hours and such.     510

* Optional - if left blank the default is used.

Fields

The response from the web service is a table with the specification below. Where no items are found, the response will be empty (although all endpoints specify the columns). If an error occurs, the response will not follow this format. Instead the response will be an error table (see general and specific errors).

Name Type Description Values Example
SegmentNumber Integer A zero based counter indicating the row number.   0
StepNumber Integer A zero based counter indicating the row number.   0
Action String The type of routing instruction.   D
Description String Textual description of the routing instruction.   Depart EAST from start on [Moseley Road]
Road String The name of the road to turn onto.   [Moseley Road]
StepTime Integer The time in seconds for this part of the route.   16
StepDistance Integer The distance in metres for this part of the route.   149
TotalTime Integer The total time in seconds for the route.   16
TotalDistance Integer The total distance in metres for the route.   149
Line Shape The polyline in the given format.   LINESTRING (52.23261 -2.27087,52.23283 -2.26962,52.23287 -2.26948,52.23295 -2.26923,52.23311 -2.26888)

Prices

This table will outline the costs (in credits) or required licenses for this web service. Many web services support both credits or licenses while many are free!

Option Cost Notes
Credit Pack: Standard 1 credit(s) This is the base price. Each route consumes four times this with an extra 1 for each waypoint.

Response Errors

Below are the errors which are specific to this web service (more general errors are listed below). If an error occurs, an error table like the one below will be returned (developers should test for a 4 column table with columns "Error", "Description", "Cause" and "Resolution". An error response will only contain a single row.

Error Description Cause Resolution
1001 Start Required The Start parameter was not supplied. Please ensure that you supply the Start parameter and try again.
1002 Start Invalid The Start parameter must be latitude + longitude separated by commas or a postcode or an easting, northing coordinate pair separated by commas. Check the parameter and try again.
1003 Finish Required The Finish parameter was not supplied. Please ensure that you supply the Finish parameter and try again.
1004 Finish Invalid The Finish parameter must be latitude + longitude separated by commas or a postcode or an easting, northing coordinate pair separated by commas. Check the parameter and try again.
1005 One or more Waypoints Invalid Waypoints must be latitude + longitude separated by commas or a postcode or an easting, northing coordinate pair separated by commas. Check the parameter and try again.
1006 DistanceType Invalid The DistanceType parameter was not recognised. Valid values are "Fastest" and "Shortest". Check the DistanceType and try again.
1007 Route Not Possible It was not possible to calculate a route. This is usually because one or more of the locations were invalid, too far from the road network or no route exists between the locations. Check all the locations and try again.
1008 LineStyle Invalid The LineStyle parameter was not recognised. Valid values are "WKTLatLong", "WKTEastNorth", "JSLatLong", "JSEastNorth", and "PCACompressable". Check the LineStyle and try again.
1009 Height invalid The Height parameter is invalid. Please enter a positive integer and try again.
1010 Weight invalid The Weight parameter is invalid. Please enter a positive integer and try again.
1011 Width invalid The Width parameter is invalid. Please enter a positive integer and try again.
1012 Length invalid The Length parameter is invalid. Please enter a positive integer and try again.
1013 AxleWeight invalid The AxleWeight parameter is invalid. Please enter a positive integer and try again.
1014 StartDay invalid The StartDay parameter was not recognised. Ensure the StartDay parameter is one of the exact given values.
1015 StartTime invalid The StartTime parameter was incorrect. Ensure the StartTime parameter is an integer between 0 and 1439.
1016 StartDay or StartTime not provided If either StartDay or StartTime is provided, both must be provided. Ensure both or neither of the StartDay and StartTime parameters are provided.

General Errors

These errors are general service errors and may be returned by any web service. Note that general errors are all below 100 while service specific errors start at 1000.

Error Description Cause Resolution
-1 Unknown error The cause of the error is unknown but details have been passed to our support staff who will investigate. These problems are typically short lived and often resolved by trying again in a few minutes.
2 Unknown key The key you are using to access the service was not found. Please check the key is correct, it should be the in form AA11-AA11-AA11-AA11.
3 Account out of credit Your account is either out of credit or has insufficient credit to service this request. Please check your account balance and top it up if necessary.
4 Request not allowed from this IP The request was disallowed from the IP address. Check the security settings on the key first. If that looks fine, please contact support as it may be from an IP addresses on our blacklist.
5 Request not allowed from this URL The request was disallowed from the URL. Check the security settings on the key first. If that looks fine, please contact support as it may be from a URL on our black list.
6 Web service not available on this key The requested web service is disallowed on this key. Check the security settings on the key first. You can limit a key to certain web services.
7 Web service not available on your plan The requested web service is not currently available on your payment plan. Some services are only available in specific regions due to licensing restrictions. Please contact us for more information.
8 Key daily limit exceeded The daily limit on the key has been exceeded. Alter the daily limit on the key if the usage seems normal. Check the usage details first though to see if it is unexpected.
9 Surge protector running The surge protector is currently enabled and has temporarily suspended access to the account. You can disable the surge protector at any time but this is only recommended if you are running through a batch of requests.
10 Surge protector triggered An unusually large number of requests have been processed for your account and the surge protector has been enabled. You can disable the surge protector at any time but this is only recommended if you are running through a batch of requests.
11 No valid license available The request requires a valid license but none were found. Please check your purchase history, you may be using a license that is no longer valid or of an incorrect type.
12 Management key required To use this web service you require a management key. Management can be enabled on any key but it is recommended management keys are use with care. Log onto the website and create a new management key or change an existing key.
13 Demo limit exceeded The daily demonstration limit for this service or account has been exceeded. The limit will be reset at midnight tonight or, if you would like the limit increased, please contact us.
14 Free service limit exceeded You have used too many free web services. Many of our web services are designed to operate in several stages - the first is usually a Find service followed by a Retrieve. If you use too many Finds without the corresponding number of retrieves you will receive this error. For more information, please contact us.
15 Wrong type of key The type of key you're using isn't supported by this web service. This usually happens if you're using a user or server license with a web service that only supports transactional keys. Please try another key and try again.
16 Key expired The key you are trying to use has expired. Please check that you are using the right key - a new one may have been issued if you have recently renewed your key. Please contact us if your have any questions.