29
Toll Cost Extension API Developer's Guide Version 1.1.0

Toll Cost Extension APIdocumentation.developer.here.com/pdf/routing_road... · The HERE Toll Cost Extension API (TCE) is a is a service that provides a calculation of the toll costs

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Toll Cost Extension APIdocumentation.developer.here.com/pdf/routing_road... · The HERE Toll Cost Extension API (TCE) is a is a service that provides a calculation of the toll costs

Toll Cost Extension APIDeveloper's Guide

Version 1.1.0

Page 2: Toll Cost Extension APIdocumentation.developer.here.com/pdf/routing_road... · The HERE Toll Cost Extension API (TCE) is a is a service that provides a calculation of the toll costs

Toll Cost Extension API Developer's Guide 2►  Contents  

Contents

Legal Notices..........................................................................................................................................................4

Document Information.................................................................................................................................... 5

Chapter 1: Overview................................................................................................................................. 6What is the Toll Cost Extension API?.........................................................................................................7

Why use the Toll Cost Extension API?.......................................................................................................8

Chapter 2: Quick Start........................................................................................................................... 9Making your first request...........................................................................................................................10

Chapter 3: User Guide......................................................................................................................... 13Acquiring Credentials...................................................................................................................................14

Constructing a Request.............................................................................................................................. 14

Customer Integration Testing.......................................................................................................14

Key Concepts.................................................................................................................................................15

Examples.........................................................................................................................................................16

Example TCE Request..................................................................................................................... 16

Service Support............................................................................................................................................ 17

Chapter 4: API Reference................................................................................................................. 18TollCost Resource - Input.......................................................................................................................... 19

Input Interface..................................................................................................................................19

Input parameter [vspec]................................................................................................................ 20

Input parameter [start_ts].............................................................................................................22

Input parameter [route]................................................................................................................. 22

TollCost Resource - Output.......................................................................................................................22

JSON response................................................................................................................................. 23

Response Elements......................................................................................................................... 24

Page 3: Toll Cost Extension APIdocumentation.developer.here.com/pdf/routing_road... · The HERE Toll Cost Extension API (TCE) is a is a service that provides a calculation of the toll costs

Toll Cost Extension API Developer's Guide 3►  Contents  

Response Values.............................................................................................................................. 26

HTTP Status Codes......................................................................................................................................29

Page 4: Toll Cost Extension APIdocumentation.developer.here.com/pdf/routing_road... · The HERE Toll Cost Extension API (TCE) is a is a service that provides a calculation of the toll costs

Toll Cost Extension API Developer's Guide 4►  Legal Notices  

Legal Notices© 2015 HERE. All rights reserved.

This material, including documentation and any related computer programs, is protected by

copyright controlled by HERE. All rights are reserved. Copying, including reproducing, storing,

adapting or translating, any or all of this material requires the prior written consent of HERE. This

material also contains confidential information, which may not be disclosed to others without the

prior written consent of HERE.

Trademark Acknowledgements

HERE and Nokia are trademarks or registered trademarks of Nokia Corporation in the United States

and other countries.

Other trade names are trademarks or registered trademarks of their owners.

Disclaimer

This content is provided "as-is" and without warranties of any kind, either express or implied,

including, but not limited to, the implied warranties of merchantability, fitness for a particular

purpose, satisfactory quality and non-infringement. Nokia does not warrant that the content is error

free and Nokia does not warrant or make any representations regarding the quality, correctness,

accuracy, or reliability of the content. You should therefore verify any information contained in the

content before acting on it.

To the furthest extent permitted by law, under no circumstances, including without limitation Nokia's

negligence, shall Nokia be liable for any damages, including, without limitation, direct, special,

indirect, punitive, consequential, exemplary and/ or incidental damages that result from the use or

application of this content, even if Nokia or an authorized representative has been advised of the

possibility of such damages.

Page 5: Toll Cost Extension APIdocumentation.developer.here.com/pdf/routing_road... · The HERE Toll Cost Extension API (TCE) is a is a service that provides a calculation of the toll costs

Toll Cost Extension API Developer's Guide 5►  Document Information  

Document Information 

 

Product

   Name: Toll Cost Extension API

   Version: Version 1.1.0

   

Document

   Name: Toll Cost Extension API Developer's Guide

   Id: 0202d1d-1423559695

   Status: FINAL

   Date: 2015-Feb-10, 9:15 (GMT)

Page 6: Toll Cost Extension APIdocumentation.developer.here.com/pdf/routing_road... · The HERE Toll Cost Extension API (TCE) is a is a service that provides a calculation of the toll costs

Toll Cost Extension API Developer's Guide 6►  Overview  

Chapter

1

OverviewTopics:

• What is the Toll Cost ExtensionAPI?

• Why use the Toll Cost ExtensionAPI?

This document introduces the Toll Cost Extension API

Page 7: Toll Cost Extension APIdocumentation.developer.here.com/pdf/routing_road... · The HERE Toll Cost Extension API (TCE) is a is a service that provides a calculation of the toll costs

Toll Cost Extension API Developer's Guide 7►  Overview  

What is the Toll Cost Extension API?The HERE Toll Cost Extension API (TCE) is a is a service that provides a calculation of the toll costs for

a given route based on a defined vehicle profile. Available as a REST web service, TCE service relies on

the HERE Toll dataset.

Figure 1: Typical Application Control Flow

The Toll Cost Extension API input is composed of 2 main elements:

• The route

◦ Input of road segments coming from the HERE Enterprise Routing Service or from the Route

Match Extension service

• The vehicle specifications

◦ As the toll systems in place in the different countries are based on vehicle attributes, these

must be provided to clearly define the profile of the vehicle (weight, height, number of axles,

emission type…) and to match the applicable toll costs

The Toll Cost Extension API output gives toll costs by country, in which are detailed:

Page 8: Toll Cost Extension APIdocumentation.developer.here.com/pdf/routing_road... · The HERE Toll Cost Extension API (TCE) is a is a service that provides a calculation of the toll costs

Toll Cost Extension API Developer's Guide 8►  Overview  

• The administrative area admission costs, which are all usage fee required for all routes within the

country

• The road sections costs, which are all usage fee required for routes as defined by the toll

operator

For these 2 kinds of costs, all the links ids where applicable are provided, as well as all the related

conditional information (pass availability, currency, methods of payment, discount options…).

Why use the Toll Cost Extension API?Toll Cost Extension API is a really easy-to-use solution giving access to a complex mechanism of toll

cost calculation:

• Provides seamless cross border toll cost calculation

• Easy to plug into existing solutions thanks to support for web standards (REST, JSON)

• Enables worldwide Toll Cost content usage through one single interface

• Provides performance and capacity to process large amounts of requests

• Based on permanently updated and quality tested toll information.

The most typical use-cases are, among others:

• Cost Planning

◦ For transportation cost planning toll cost are an important factor. Using the toll cost

calculation allows to accurately calculate transportation costs that are used e.g. for

quotations and budget planning

• Cost Control

◦ Comparing incoming toll cost receipts and invoices with the pre calculated costs for control

purposes

Page 9: Toll Cost Extension APIdocumentation.developer.here.com/pdf/routing_road... · The HERE Toll Cost Extension API (TCE) is a is a service that provides a calculation of the toll costs

Toll Cost Extension API Developer's Guide 9►  Quick Start  

Chapter

2

Quick StartTopics:

• Making your first request

This article helps you start using the Toll Cost Extension API.

Page 10: Toll Cost Extension APIdocumentation.developer.here.com/pdf/routing_road... · The HERE Toll Cost Extension API (TCE) is a is a service that provides a calculation of the toll costs

Toll Cost Extension API Developer's Guide 10►  Quick Start  

Making your first requestSometimes the easiest way to start using new software is to run simple working examples.

app_id and app_code are authentication credentials. You can use the demo credentials in the

examples for testing, but must substitute them with your own unique values in your website or

application. See Acquiring Credentials on page 14 for more information.

The examples in this guide use the Customer Integration Testing (CIT) environment. This environment

allows you to test your software. For production please use the production environment. See

Constructing a Request on page 14 for the base URLs of both environments.

Note that most example URLs in this guide are broken up into multiple lines for better readability.

Remove these line breaks and spaces when copying and pasting the examples to make sure URLs are

still well formed.

Prerequisites

The only thing you need to start using the Toll Cost Extension API is an HTTP client. Choose any

HTTP client application you are familiar with. A command line tool like curl will do the job, as will any

modern web browser.

Available Maps

The Toll Cost Extension service is based on Platform Data Extension to get the data needed to

calculate the toll cost of the provided route. Therefore, the TCE requests must be provided with

the region and release on which to base the calculation. If you obtain the route from the Enterprise

Router or the Route Match Extension, then use the release that they return. Find out, which map

releases and regions are available:

http://pde.cit.api.here.com/1/doc/maps.json?app_id=DemoAppId01082013GAL&app_code=AJKnXv84fjrb0KIHawS0Tg

{"maps":[ {"coverage":"EU","releaseYearAndQuarter":"2013Q4"}, {"coverage":"NA","releaseYearAndQuarter":"2014Q2"}, {"coverage":"SAM","releaseYearAndQuarter":"2013Q4"}, ...]}

Page 11: Toll Cost Extension APIdocumentation.developer.here.com/pdf/routing_road... · The HERE Toll Cost Extension API (TCE) is a is a service that provides a calculation of the toll costs

Toll Cost Extension API Developer's Guide 11►  Quick Start  

Calculate Route

The Toll Cost Extension expects the route definition as list of link IDs. Such a route can be

constructed by the Enterprise Router (planning use case) or by the Route Match Extension (analysis

use case). Route calculation example:

https://route.nlp.nokia.com/routing/6.2/calculateroute.json?&waypoint0=48.42732%2C2.5409&waypoint1=51.7094%2C-3.35138&mode0=fastest;car&legattributes=all&app_id=DemoAppId01082013GAL&app_code=AJKnXv84fjrb0KIHawS0Tg

{ "Response" : { "MetaInfo" : { ... AdditionalData : [ ... { "value" : "2014Q2" , "key" : "Map0" }, ... ] }, "Route" : [ { ... "Leg" : [ { ... "Link" : [ { ... "LinkId" : "+748873330", ... }, { ... "LinkId" : "+68614309", ... }, { ... "LinkId" : "-737272743", ... } ... ] } ], ... } ]} }

Request to TCE API

http://tce.cit.api.here.com/1/tollcost.json?app_id=DemoAppId01082013GAL&app_code=AJKnXv84fjrb0KIHawS0Tg

Page 12: Toll Cost Extension APIdocumentation.developer.here.com/pdf/routing_road... · The HERE Toll Cost Extension API (TCE) is a is a service that provides a calculation of the toll costs

Toll Cost Extension API Developer's Guide 12►  Quick Start  

&region=EU&release=2014Q2&start_ts=2014-10-09T16:26:00&vspec=3;0;0;2;0;0;6;350;0;10000;10000;0;0;0;1;8;0;0&route=748873330;68614309;17357322;748938713;76719821;17357323

{ "countries" : [ { "name": "FRA", "roadSectionsCosts": [ { "linksIds": [ 748938713, 76719821 ], "conditions": [ { "time":"", "pass":"", "amount":7.4, "currency":"EUR", "methodsOfPayment":151, "daylightHours":2, "discountAvailable":0 } ] }, ], "adminAdmissionCosts":null } ], "errors": [ ], "onError":false}

Page 13: Toll Cost Extension APIdocumentation.developer.here.com/pdf/routing_road... · The HERE Toll Cost Extension API (TCE) is a is a service that provides a calculation of the toll costs

Toll Cost Extension API Developer's Guide 13►  User Guide  

Chapter

3

User GuideTopics:

• Acquiring Credentials

• Constructing a Request

• Key Concepts

• Examples

• Service Support

The articles in this section provide a guide to using the Toll Cost

Extension API:

• explains key concepts

• provides examples

Page 14: Toll Cost Extension APIdocumentation.developer.here.com/pdf/routing_road... · The HERE Toll Cost Extension API (TCE) is a is a service that provides a calculation of the toll costs

Toll Cost Extension API Developer's Guide 14►  User Guide  

Acquiring CredentialsAll users of HERE APIs must obtain authentication and authorization credentials and provide them as

values for the parameters app_id and app_code. The credentials are assigned per application.

To obtain the credentials for an application, please visit http://developer.here.com/get-started for

more details.

Constructing a RequestA request to the Toll Cost Extension API includes the basic elements shown in the following table and,

in addition, it may contain resource-specific parameters or data.

Table 1: Basic request elements

Element Value/Example Description

Base URL http://tce.api.here.com

http://tce.cit.api.here.com

Production environment only

CIT environment: see Customer

Integration Testing on page 14

Path /1/  

Resource tollcost GET/POST, specify request details via

query parameters

Application Code &app_code=AJKnXv84fjrb0KIHawS0Tg Substitute your own unique

app_code

Application Id &app_id=DemoAppId01082013GAL Substitute your own unique app_id

Customer Integration TestingHERE is committed to maintain the best possible production service for all customers. Given that the

production environment is live and common to all API users, we request that you use the alternative

Customer Integration Testing (CIT) environment when evaluating our products, running tests, making

changes in your code and altering the way you access our APIs.

The CIT environment also allows you to test your software against a newer version of the service

before HERE brings that version into production. CIT offers a fully functional environment for

Page 15: Toll Cost Extension APIdocumentation.developer.here.com/pdf/routing_road... · The HERE Toll Cost Extension API (TCE) is a is a service that provides a calculation of the toll costs

Toll Cost Extension API Developer's Guide 15►  User Guide  

customers to use for development and testing, but it does not support high loads or performance

testing in general.

Note that the same application id can be used in both environments, but CIT may require a dedicated

application code. If this is the case, please contact us as described under Service Support on page

17.

The CIT environment is not intended for general production use.

Key ConceptsThis section provides insights into the key concepts used throughout the Toll Cost Extension API.

How to Obtain a Route?

The route is provided as sequence of Permanent Link IDs. A route can be constructed by the HERE

Routing Web service or the HERE Route Match Web service (RME). The route link IDs can also be

obtain through the HERE Reverse Geocoding Web service, from processing HERE Core Map data or

through any other means.

Vehicle specifications

Toll costs are always given for specific vehicles: the usage fee required to use a specific road network

or go through a toll booth will be different whether the vehicle is a motorbike or a truck. Therefore

when computing the toll costs of a given route, TCE needs to know the most precisely possible all

the specifications of the vehicle to be able to choose between the different fees the one(s) which are

the closest. Hence when issuing a request to TCE, the client has to provide the specifications of the

vehicle as a string, summing up different attributes like:

• Category: motorcycle, truck, auto...

• Trailer type: none, trailer, caravan

• Vehicle number of axles

• ....

Types of costs

The due costs for road usage can be divided in two categories:

• Road section costs: fees that the driver must pay to use a specific road, section of road or to

through a specific toll booth

Page 16: Toll Cost Extension APIdocumentation.developer.here.com/pdf/routing_road... · The HERE Toll Cost Extension API (TCE) is a is a service that provides a calculation of the toll costs

Toll Cost Extension API Developer's Guide 16►  User Guide  

• Administrative area admission costs: fees that the driver must pay in order to gain access to the

road network of a specific area

These two categories are returned separately in TCE response to a request.

ExamplesThis section provides examples of requests along with the responding results.

Example TCE Request

User Story

The user wants to retrieve the toll costs for a route knowing its link ids (computed by the Enterprise

Router for instance) for a truck without trailer.

Request Summary

The following list summarizes the elements required to create a request matching the user story and

shows, in square brackets, how those elements are used in the request example below. Note that the

request example also uses the authentication parameters.

Resource: tollcost

Parameters: region [EU], map region, like EU, NA, APAC...

release [2014Q2], map release quarter (can be retrieved from the HERE

Enterprise Routing Service response meta data)

start_ts [2014-11-01T08:00:00 or now], start date of the route

vspec [3;0;0;2;0;0;6;350;0;10000;10000;0;0;0;1;8;0;0], string

representation of the vehicle specifications

route

[748873330;68614309;17357322;748938713;76719821;17357323],

link ids of the route

Request

http://tce.cit.api.here.com/1/tollcost.json?app_id=DemoAppId01082013GAL

Page 17: Toll Cost Extension APIdocumentation.developer.here.com/pdf/routing_road... · The HERE Toll Cost Extension API (TCE) is a is a service that provides a calculation of the toll costs

Toll Cost Extension API Developer's Guide 17►  User Guide  

&app_code=AJKnXv84fjrb0KIHawS0Tg&region=EU&release=2014Q2&start_ts=2014-11-01T08:00:00&vspec=3;0;0;2;0;0;6;350;0;10000;10000;0;0;0;1;8;0;0&route=748873330;68614309;17357322;748938713;76719821;17357323

Response

{ "countries" : [ { "name": "FRA", "roadSectionsCosts": [ { "linksIds": [ 748938713, 76719821 ], "conditions": [ { "time":"", "pass":"", "amount":7.4, "currency":"EUR", "methodsOfPayment":151, "daylightHours":2, "discountAvailable":0 } ] }, ], "adminAdmissionCosts":null } ], "errors": [ ], "onError":false}

Service SupportIf you need assistance with this or other HERE products, please contact your HERE representative or

Technical Customer Support.

Page 18: Toll Cost Extension APIdocumentation.developer.here.com/pdf/routing_road... · The HERE Toll Cost Extension API (TCE) is a is a service that provides a calculation of the toll costs

Toll Cost Extension API Developer's Guide 18►  API Reference  

Chapter

4

API ReferenceTopics:

• TollCost Resource - Input

• TollCost Resource - Output

• HTTP Status Codes

This section provides descriptions of the resources, parameters,

return types and error codes of the HERE Toll Cost Extension API.

Page 19: Toll Cost Extension APIdocumentation.developer.here.com/pdf/routing_road... · The HERE Toll Cost Extension API (TCE) is a is a service that provides a calculation of the toll costs

Toll Cost Extension API Developer's Guide 19►  API Reference  

TollCost Resource - InputAll parameter values including letters outside A-Z and a-z must be first UTF-8 encoded and then URL

encoded. Every URL unsafe character should be URL encoded.

Input Interface

Resource URI

/tollcost

Resource Parameters

Parameter Type Description

region String Map coverage region, e.g. APAC, AUS, EU, IND, MEA, NA, SAM, TWN.

release String Map release quarter, e.g. 2014Q1 to which the route link IDs belong. Note that

while the IDs are permanent, there can be changes between map releases, e.g. if

a link got split into two links. The HERE Routing service and the HERE Route Match

service (RME) return their current map release in the response.

app_id String Typically, but not guaranteed to be, 20 bytes Base64 URL-safe encoded string

used for the authentication of the client application. See Acquiring Credentials on

page 14.

app_code String Typically, but not guaranteed to be, 20 bytes Base64 URL-safe encoded string

used for the authentication of the client application. See Acquiring Credentials on

page 14.

vspec String Semi-column separated string containing all the vehicle specifications. See

detailed description of this parameter

start_ts String Start timestamp of the route. See detailed description of this parameter

route String Detailed information about the route. See detailed description of this parameter

callback String Specifies the name of a user-defined function used to wrap the JSON response.

Page 20: Toll Cost Extension APIdocumentation.developer.here.com/pdf/routing_road... · The HERE Toll Cost Extension API (TCE) is a is a service that provides a calculation of the toll costs

Toll Cost Extension API Developer's Guide 20►  API Reference  

Input parameter [vspec]

Format

List of semi-column ";" separated values

Description

Position in string Parameter Description

1 Category Integer, Enum [1,2,3,4,5,6,7,8,9,10,11,12]

• WORLD : [1=Motorcycle, 2=Auto, 3=Truck, 4=Motor home, 5=Minibus,

6=Bus]

• EU ONLY : [7=Motorcycle Sidecar, 8=Tricycle, 9=Delivery Truck]

2 Trailer type Integer, Enum [0,1,2]

• [0=None, 1=Caravan, 2=Trailer]

3 Number of trailers Integer, Enum [0,1,2,3]

• if trailer type (param number 2) is 0 : must be 0

• else : must be in [1=Truck with one more trailers, 2= Truck with two or more

trailers, 3=Truck with three or more trailers]

4 Number of axles

vehicle

Integer, must be > 0

5 Number of axles

trailer

Integer, 0 or more

• if trailer type (param number 2) is 0 : must be 0

• else : must be > 0

6 Hybrid Integer, Enum [0,1]

• set to 1 if the vehicle is partly running on electricity

• set to 0 otherwise

7 Emission type Integer, Enum [1,2,3,4,5,6,7,8]

• [1=EURO I, 2=EURO II, 3=EURO III, 4=EURO IV, 5=EURO V, 6=EURO VI, 7=EURO

EEV, 8=Electric Vehicles]

8 Vehicle height Integer, must be > 0

• USA : Inches with precision zero

• REST OF THE WORLD : Centimeters with precision zero

9 Trailer height Integer, 0 or more

Page 21: Toll Cost Extension APIdocumentation.developer.here.com/pdf/routing_road... · The HERE Toll Cost Extension API (TCE) is a is a service that provides a calculation of the toll costs

Toll Cost Extension API Developer's Guide 21►  API Reference  

Position in string Parameter Description

• if trailer type (param number 2) is 0 : must be 0

• else : must be > 0

• USA : Inches with precision zero

• REST OF THE WORLD : Centimeters with precision zero

10 Vehicle weight Integer, must be > 0

• USA : Pounds (lbs) with precision zero

• REST OF THE WORLD : Kilograms (KG) with precision zero

11 Total weight Integer, total weight of the vehicle including trailer(s) or caravan. Must be > 0

• USA : Pounds (lbs) with precision zero

• REST OF THE WORLD : Kilograms (KG) with precision zero

12 Disabled equipped Integer, Enum [0,1]

• set to 1 if the vehicle is specially equipped for transporting disabled people

• set to 0 otherwise

13 Minimal pollution Integer, Enum [0,1]

• set to 1 if the vehicle is considered to cause minimal pollution

• set to 0 otherwise

14 HOV Integer, Enum [0,1]

• set to 1 if the vehicle is considered as an HOV (High Occupancy Vehicle)

• set to 0 otherwise

15 Number of

passengers

Integer, must be > 0

16 Number of tires Integer, must be > 0

17 Commercial Integer, Enum [0,1]

• set to 1 if the vehicle is designed for commercial use

• set to 0 otherwise

18 Hazardous type Integer, Enum [0,1,2]

• [0=None, 1=Explosives, 2=Any hazardous material]

Examples

Passenger car: vspec=2;0;0;2;0;0;5;167;0;1739;1739;0;0;0;2;4;0;0

7.5 ton truck: vspec=3;0;0;2;0;0;5;340;0;7500;7500;0;0;0;1;4;1;0

38 ton truck with trailer: vspec=3;2;1;2;3;0;5;400;400;24000;38000;0;0;0;1;6;1;0

Page 22: Toll Cost Extension APIdocumentation.developer.here.com/pdf/routing_road... · The HERE Toll Cost Extension API (TCE) is a is a service that provides a calculation of the toll costs

Toll Cost Extension API Developer's Guide 22►  API Reference  

Input parameter [start_ts]

Format

YYYY + '-' + MM + '-' + DD + 'T' + hh + ':' + mm + ':' + ss

Description

Parameter Description

YYYY Four-digit numeral that represents the year.

MM Two-digit numeral that represents the month

DD Two-digit numeral that represents the day

hh Two-digit numeral that represents the hour. The value 24 is permitted if the minutes and seconds

represented are zero, and the dateTime value so represented is the first instant of the following

day (the hour property of a dateTime object in the value space cannot have a value greater than 23)

mm Two-digit numeral that represents the minute

ss Two-integer-digit numeral that represents the whole seconds

Input parameter [route]

Format

List of route details objects. Each route detail is only a link id. Link ids must be separated from each

other by the character ";"

Example

For a route going through following link ids: 554987845,1213212 and -9998745, the query string

must look like:

route=554987845;1213212;-9998745

TollCost Resource - OutputThe response is provided in JSON format. Below are detailed the elements of the response as well as

the literal values.

Page 23: Toll Cost Extension APIdocumentation.developer.here.com/pdf/routing_road... · The HERE Toll Cost Extension API (TCE) is a is a service that provides a calculation of the toll costs

Toll Cost Extension API Developer's Guide 23►  API Reference  

JSON response{ "countries": [ { "name": ..., "roadSectionsCosts": [ { "linksIds": [ ..., ..., ... ], "conditions": [ { "time": ..., "pass": ..., "amount": ..., "currency": ..., "methodsOfPayment": ..., "daylightHours": ..., "discountAvailable": ... }, ... ] }, ... ], "adminAdmissionCosts": { "linksIds": [ ..., ..., ... ], "name": ..., "conditions": [ { "time": ..., "pass": ..., "amount": ..., "currency": ..., "methodsOfPayment": ..., "daylightHours": ..., "discountAvailable": ... }, ... ] }, "usageFeeRequiredLinks": { "linksIds": [ ..., ..., ... ], "conditions": null } }, ... ], "errors": [ ..., ..., ... ], "onError": ...

Page 24: Toll Cost Extension APIdocumentation.developer.here.com/pdf/routing_road... · The HERE Toll Cost Extension API (TCE) is a is a service that provides a calculation of the toll costs

Toll Cost Extension API Developer's Guide 24►  API Reference  

}

Response Elements

Element 'countries'

Description

Array of objects, one object per country.

Properties

Parameter Description

name 3 characters iso-country-code

roadSectionCosts See detailed description of this element

adminAdmissionCosts See detailed description of this element

usageFeeRequiredLinks See detailed description of this element

Element 'roadSectionCosts'

Description

Array of objects, one object per road section cost where a toll is applicable.

Properties

Parameter Description

linksIds array of links ids (strings)

conditions See detailed description of this element

Element 'adminAdmissionCosts'

Description

Object representing the costs related to the current administrative area (country).

Page 25: Toll Cost Extension APIdocumentation.developer.here.com/pdf/routing_road... · The HERE Toll Cost Extension API (TCE) is a is a service that provides a calculation of the toll costs

Toll Cost Extension API Developer's Guide 25►  API Reference  

Properties

Parameter Description

linksIds array of links ids (strings)

name name of the administrative area (string)

conditions See detailed description of this element

Element 'usageFeeRequiredLinks'

Description

Object representing the links where a usage fee is required, but without detailed information.

Properties

Parameter Description

linksIds array of links ids (strings)

conditions Always null, generated for parsing compatibility

Element 'conditions'

Description

Array of objects, one per toll condition. One condition represents the toll costs and conditions

applied to the related set of links.

Properties

Parameter Description

time string value, See detailed description of this value

pass string value, See detailed description of this value

amount float value, cost to be paid for this toll

currency string value, 3-iso-code currency

methodsOfPayment string value, See detailed description of this value

daylightHours integer value, See detailed description of this value

Page 26: Toll Cost Extension APIdocumentation.developer.here.com/pdf/routing_road... · The HERE Toll Cost Extension API (TCE) is a is a service that provides a calculation of the toll costs

Toll Cost Extension API Developer's Guide 26►  API Reference  

Parameter Description

discountAvailable integer value, See detailed description of this value

Element 'errors'

Description

Array of strings, one per error encountered during the process or the validation of input request

parameters. If this array is empty, the “onError” element value is false; otherwise, the “onError”

element value is true.

Element 'on-error'

Description

String value, indicating whether an error (or several) has happened during the process or the

validation of input request parameters. If the “errors” array is empty, this element value is false;

otherwise, this element value is true.

Response Values

Value 'time'Comma separated list of Date/Time modifiers to indicate specific time periods when the toll cost

applies.

One entry contains following colon separated values:

• DATETIME_TYPE:High level indication of the period for which the date time restriction is valid.

The value of this type effects the interpretation of START_DATE/END_DATE

◦ C - Day of Month, Example: 00010000 - f.e. 1 January, 1 February,..., 1 December

◦ D - Day of Week of Month, Example: 00010002 - 2nd Sunday of each month, 00020001 - 1st

Monday of each month, 00070002 - 2nd Saturday of each month, 00060005 - 5th Friday of

each month

◦ E - Day of Week of Year, Example: 00030020 - Tuesday of week 20, 00050052 - Thursday of

week

Page 27: Toll Cost Extension APIdocumentation.developer.here.com/pdf/routing_road... · The HERE Toll Cost Extension API (TCE) is a is a service that provides a calculation of the toll costs

Toll Cost Extension API Developer's Guide 27►  API Reference  

◦ F - Week of Month, Example: 00020000 - 2nd week of each month

◦ H - Month of Year, Example: 00010000 - January, 00070000 - July

◦ I - Day of Month of Year, Example: 00150001 - 15 January of each year, 00300004 - 30 April

of each year

◦ 1 - Day of week starting with Sunday, Example: X XX - Sunday and Friday and Saturday,

XXXXXXX - all weekdays

◦ 2 - External date, Example: Easter

◦ A - Date Ranges, Example: 20131119 - 19th of november year 2013

▪ For Date Time Type = A-I, the Start Date represents the start of the range and the End

Date represents the end of the range.

▪ For Date Time Type = 1, Start Date identifies the day(s) of the week. End Date is not

published for Date Time Type = 1.

▪ For Date Time Type = 2, Start Date identifies the name of the external date. The only

currently existing situation is "Easter". End Date is not published for Date Time Type = 2.

• FROM_END:This attribute allows time to be specified 'from the end' of a standard time period

such as month and year

• EXCLUDE_DATE:Flag that indicates if the specified data (in Date Time Type) represents an

excluded date. Example, all year except 30 April is modelled Exclude Date = Y, with Start Date =

30 April

• START_DATE:Identifies the start dates of the Date/Time for Date Time Type = A-I. Identifies the

days of the week for Date Time Type = 1 and the external date for Date Time Type = 2

• END_DATE:Identifies the end date of the Date/Time for Date Time Types = A-I

• START_TIME:Identifies the start time for the time period in which the Date Time restriction is in

effect. Time in format HHMM, where a 24 hour clock is used. Range 0000...2400. Example: 1130

means 11:30 and 2115 means 21:15

• END_TIME:Identifies the end time for the time period in which the Date Time restriction is in

effect. Time in format HHMM, where a 24 hour clock is used. Range 0000...2400. Example: 1130

means 11:30 and 2115 means 21:15 s

Value 'pass'Pass information applicable for this toll cost. The information are represented by a concatenate

string, as described below. The string is always prefixed by a unique id (integer) followed by the ";"

character.

Page 28: Toll Cost Extension APIdocumentation.developer.here.com/pdf/routing_road... · The HERE Toll Cost Extension API (TCE) is a is a service that provides a calculation of the toll costs

Toll Cost Extension API Developer's Guide 28►  API Reference  

After this prefix, the string is the concatenation of 3 elements, separated by the ":" character:

• The bit sum of validity information (see description below)

• The number of days the pass is valid for

• The number of months the pass is valid for

The bit sum of validity information is composed of these values:

• 1: the pass is valid for a year (annual)

• 2: the pass is valid for a year plus the month prior to the specified year and the month following

the specified year (Dec-Jan)

• 4: the pass is valid for Senior people only

Several passes can be applied for this toll cost, if it is the case the different passes information are

separated by the "," character.

Value 'methodsOfPayment'Methods of payment applicable to this toll cost, represented as a bit sum. The values are:

• 1: Cash

• 2: Bank card

• 4: Credit card

• 8: Pass / subscription

• 16: Transponder

• 32: Video toll charge

• 64: Exact cash

• 128: Travel card

Value 'daylightHours'Integer value:

• 0: toll cost applicable during non-daylight hours

• 1: toll cost applicable during daylight hours

• 2: information not available

Page 29: Toll Cost Extension APIdocumentation.developer.here.com/pdf/routing_road... · The HERE Toll Cost Extension API (TCE) is a is a service that provides a calculation of the toll costs

Toll Cost Extension API Developer's Guide 29►  API Reference  

Value 'discountAvailable'Integer value:

• 0: no discount available

• 1: discount available under certain circumstance

HTTP Status CodesToll Cost Extension API supports the standard HTTP status codes

Error code Description

200 OK Indicates success, but may also be returned when an invalid resource name and/or an invalid

parameter combination has been used in the request.

400 Bad request Invalid parameter value in the request.

401 Unauthorized Invalid authentication.

403 Forbidden Incorrect app_code or app_id in the request. See Acquiring Credentials on page 14 for

more information.

404 Not found Resource not found.

500 Internal error There is a server configuration issue.

503 Service Unavailable Indicates that the service is temporarily unavailable due to system overload or maintenance

or the resource is currently disabled.