GuidesAPI Reference
Guides

How to read a HERE Geofencing API v8 response

The resource /v8/geofence provides a response that includes the following components:

  • An issues object that lists all the issues that the service encountered while processing the request. Your app should only use the response content if this list is empty.
  • A geometries object that lists the fence geometries that contain the asset's position or overlap the search radius around the asset's position. Only one result geometry is returned for each distinct value of the key_attribute specified. This means that if your app submits a geofence geometry comprising of multiple faces or separate top level rings, they are treated as one geometry and only one distance that is the closest line of all its rings is returned.
  • A responseCode containing the HTTP response code and response text.
  • An errorId that can be passed on to Technical Customer Support for context, if errors occur during processing.
  • Metainformation about the processing of the request, as captured in the warnings and onError objects.

Example response structure for /v8/geofence resource:

{
	issues :
		[
			{
				message : "...",
				code : ...
			},
			...
		],
	warnings :
		[
			"...",
			...
		],
	error_id : "...",
	response_code : "...",
	geometries :
		[
			{
				layerId : "...",
				distance : ...,
				nearestLat : ...,
				nearestLon : ...,
				originalLat : ...,
				originalLon : ...,
				attributes :
					{
						<attribute name 1> : "...",
						<attribute name 2> : "...",
						...
					},
				geometry : "..."
			},
			...
		],
}