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
-
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 newinitsession
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 nogetmessages
request received in this time frame, the initial sessioninitsession
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.