NDS.Live

getHeaderOnlyByTileId

Request access

Returns only the smart layer header for one tile, with its layer versions and lifetime, without the payload. Use it to check whether a tile changed before you download it.

Request data

HTTP method: POST

URL request format
https://{serviceURL}/getHeaderOnlyByTileId?apiKey={Your_API_Key}

Request body

The body is a zserio-encoded TileId object.

HTTP request headers

HeaderDescription
Content-Typeapplication/x-zserio-object, the zserio media type.
If-None-MatchOptional. The entity tag for conditional requests.

Conditional requests

To send a conditional request:

  1. Store the entity tag from the ETag response header, quotation marks included.
  2. On the next request for the same resource, send it in If-None-Match.
  3. If nothing changed, the service returns 304 with an empty body, and you keep using your cached copy. For a method that redirects to a file, the service answers 304 itself, without redirecting.

Send the entity tag in If-None-Match, not in an ETag request header. The ETag request header is deprecated.

Response data

Response body

TomTom’s Smart Layer Tile Service answers with 303 See Other. The Location response header points to a file on a TomTom content delivery network, which holds the header. Make sure your HTTP client follows redirects. Most clients do this by default. The Location URL carries a short-lived access token, so don’t cache it or write it to logs.

The file is a zserio-encoded SmartLayerHeader object. It’s the same header that starts a SmartLayerTile, without the layer data, so it’s small: for a tile with 10 layers, it’s 72 bytes.

The header has one entry per layer, in the same order in each list:

FieldDescription
numDataLayersThe number of data layers in the tile.
availableLayersThe data layer IDs, in the order the layers appear in the tile.
layerLifetimeFor each layer, its lifetime type, for example static, and its version ID.
packagingDetailsFor each layer, how its data is packaged: compression, delta encoding, encryption and signature.
legalInformationOptional. Legal information, such as copyright, for all layers.

To check whether a tile changed, compare the version IDs in layerLifetime with the ones you hold. Then request only the changed layers with getDeltaLayerByTileId.

HTTP response headers

HeaderDescription
LocationThe URL of the file that holds the header.
ETagThe entity tag of the header, for conditional requests. If you send it in If-None-Match and the header hasn’t changed, the service answers 304 without redirecting.

HTTP status codes

Besides the codes below, any method can return the common errors, for example 401 for a missing API key.

CodeMeaning
200OK. The response body holds the SmartLayerHeader.
204The tile is empty, outside the area your product covers, or at a level the service doesn’t serve. Cache an empty result and don’t retry.
303See other. The header is at the URL in the Location response header. TomTom’s service usually answers with this code.
304Not modified since the version identified in If-None-Match.
404Not found. The tile is outside the service’s spatial extent.
410Gone. The Smart Layer Tile Service is decommissioned. Ask the NDS.Live Registry for another service.
500Internal server error.