HERE Traffic TPEG API
Traffic TPEG API Developer's Guide

Start an authenticated session

The following code example shows how to start an authenticated session by sending the following XML body as an HTTP post request containing an HTTP Content-Type header of application/xml:


<?xml version="1.0" encoding="UTF-8" ?>
<init-session>
  <tpeg format="TPEGBinary">
  <loc-ref id="TMC" version="1.3"/>
  <loc-ref id="ETL" version="1.0"/>
  <app id="TEC" version="3.2"/>
  <app id="TFP" version="1.0"/>
  </tpeg>
  <configuration>
  <att name="radius" value="25"/>
  <att name="expiration" value="180"/>
  <att name="timeout" value="30"/>
  <att name="frequency" value="180"/>
  </configuration>
</init-session>

Which is sent to the initsession resource:


https://tpeg.traffic.cc.api.here.com/tpeg/1.0/initsession

Parameter overview

The following provides information on the attributes used in this example:
  • tpeg format: request traffic info in the TPEGBinary format.
  • loc-ref: any supported Location Referenicng. See Supported location referencing.
  • app: request Traffic Event Compact (TEC) version 3.0 and Traffic Flow and Prediction (TFP) 1.0 applications.
  • configuration radius: return information for an area with a radius of 25 km.
  • configuration expiration: After 180 minutes a new initsession is required.
  • configuration timeout: Optional integer in minutes. This is a notifier in the service to support DeltaUpdate functioanality. A value of '0' is to receive the full updates for every request. In other words, if there has been no getmessages request received in this time frame, the initial session initsession is still valid, serving the full updates. Default value for this timeout is 100 minutes.
  • configuration frequency: Optional integer in minutes. An indication of the update request frequency.
The XML response contains the URL and encryption key for traffic information requests such as Proximity example for getmessages and Corridor example for getmessages.