AB Routing
Introduction
The api provides walking and driving directions, ETAs & travel distances for different types of transport modes and multiple modes of routing (fastest, shortest, tolls avoidance..etc), all this while catering for real-time traffic information.
Authentication
To authenticate and use the API you need to add api-key
header to your requests with an active subscription key supporting the coverage
API, you can get your keys from subscriptions page under your AMS account.
Endpoint
Endpoint for the ab routing API is available at:
https://amsapis.azure-api.net/routing/ab-routes
Request
{
"startLocation": {
"latitude": 25.003095,
"longitude": 55.103421
},
"endLocation": {
"latitude": 25.149558,
"longitude": 55.213284
},
"waypoints": [],
"transportMode": "car",
"routingModes": [
"short",
"fast"
],
"departureTime": 1659947423000,
"arrivalTime": 1659947423000,
"return": "summary"
}
breakdown of the request as follows:
startLocation
: represents the coordinates of the starting point of the route.endLocation
: represents the coordinates of the ending point of the route.waypoints
: list of locations that the routes needs to pass on between the start and end locations.transportMode
: the transport mode of the route, which represents the vehicle type that will be used, supported transport modes are:car
,truck
,pedestrian
,bicycle
,scooter
,taxi
.routingModes
: collection of the desired routing modes options to be created, supported routing modes are:short
,fast
.departureTime
: start time of the trip covered by the route in epoch format (milliseconds).arrivalTime
: end time of the trip covered by the route in epoch format (milliseconds). only one of departureTime and arrivalTime can be passed at a time, if no time is provided departureTime will be considered as the current time.return
: possible values aresummary
andgeometry
, ifsummary
was passed the response will contain only meta data about the route, ifgeometry
was passed the response will contain a file url containing coordinates collection describing generated route.
Request Constraints:
- only one of
departureTime
andarrivalTime
can be passed at a time, if no time is provideddepartureTime
will be considered as the current time. - For
pedestrian
,bicycle
,scooter
andtaxi
transport modes onlyfast
routing mode is supported.
Response
[
{
"tripId": "123-456",
"tripGeometryUrl": "file_url",
"arrivalTime": 1659948865000,
"departureTime": 1659947423000,
"distanceInMeters": 26308,
"routingMode": "fast",
"durationInSeconds": 1442
}
]
breakdown of the response as follows: The response is a collection of trips meta data corresponding to the requested routing modes.
tripId
: a unique identifier of the trip, this id can be used to fetch the trip meta data at a later stage or in our AhoyMaps sdk for route preview or turn by turn navigation, for more information you can check the sdk documentation here: for Android and for iOS.tripGeometryUrl
: the file url containing the coordinates of the created route, this will be null if the request return type wassummary
.departureTime
: start time of the trip covered by the route in epoch format (milliseconds).arrivalTime
: end time of the trip covered by the route in epoch format (milliseconds).distanceInMeters
: total travel distance in meters.routingMode
: the routing mode which was used for this route.durationInSeconds
: total travel time in seconds.
API Documentation
To view the Open API documentation for the API click here