HERE Traffic TPEG API
Traffic TPEG API Developer's Guide

Send an initsession request

Parameters for initsession request are passed in both POST request XML body and as part of URL, which must conform to the initsession request XSD. Common parameters are listed in the following table:

Table 1. Request oarameters
Parameter Description
profile

A string value parameter which defines the profile of the client application.

Authorization
Using app_id and app_code:
app_id={YOUR_APP_ID}&app_code={YOUR_APP_CODE}
Using apiKey:
apiKey={apiKey}
For instructions on how to use token authorization, see https://developer.here.com/documentation/authentication/dev_guide/topics/token.html.
Note: The base URL for token authorization is https://tpeg.traffic.ls.hereapi.com.
Table 2. Request parameters POST
Parameter Description
tpeg

Occurs only once as a child of init-session.

  • @format: TPEGBinary.
  • @messagesize: Integer.
  • @sessionsize: Integer.
loc-ref

Occurs at least once as a child of tpeg.

  • @id: Request Traffic Message Channel (TMC)
  • @version: The version of each standard. Currently 1.3
  • @id: Request Extended TMC Locations (ETL).
  • @version: The version of each standard. Currently 1.0
  • @id: Request Open Location Reference (OLR).
  • @version: The version of each standard. Currently 1.0 .
app

Occurs at least once as a child of tpeg.

  • @id: Request Traffic Event Compact (TEC) or Traffic Flow and Prediction (TFP) 1.0 applications.
  • @version: The version of each standard. Currently 3.0 and 1.0 respectively.
configuration Can occur once as a child of init-session.
att name="radius" Optional integer in km, must be smaller than 100 km. Default value is 10 km.
att name="timeout" Optional integer in minutes. This is a notifier in the service to support delta functioanality. A value of '0' is to receive the full updates i.e, with out Delta functionality. In other words, if there has been no getmessages request received in this time frame, the initial session initsession is still valid, serving the fullupdates. Default value 100 minutes.
att name="expiration" Optional integer in minutes. After this time a new initsession is required. Default value is 999 minutes.
att name="frequency" Optional integer in minutes. An indication of the update request frequency.

Example request body


<?xml version="1.0" encoding="UTF-8"?>
<init-session>
  <tpeg format="TPEGBinary" messagesize="50000" sessionsize="1000" >
    <loc-ref id="TMC" version="1.3" />
    <loc-ref id="ETL" version="1.0" />
    <loc-ref id="OLR" version="1.0"/>
    <app id="TEC" version="3.2" />
    <app id="TFP" version="1.0" expiration="17" />
  </tpeg>
  <countries current="DE" destination="FR" />
  <configuration>
    <att name="radius" value="10" />
    <att name="expiration" value="600" />
    <att name="timeout" value="300" />
    <att name="frequency" value="180" />
  </configuration>
</init-session>
      

initsession response

All initsession responses are in XML format, conforming to the initsession response XSD.

Example response


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<init-session-response 
url="https://tpeg.cit.cc.api.here.com/tpeg/1.0/getmessages?v=5&cfg=1DpmhH-p7ElBonkVviVIDrPP3S.lVqIMc33pfUJ2luIDN58GPGDXo2zkQiizAnE-J-2W-MZbShEADKC6GFvLOO7pTnK41VTt3lRfk5cr7CFsMkXz97WRVx57LnljI-9d" 
key="99a8cd635aa563acaf0c486992d297ad">
  <config name="fcd" value="enabled"/>
</init-session-response>