GuidesAPI Reference
Guides

Action on Lookup response

The application described in the parent page allows users to save and retrieve favorite locations using their item id values.

When an end-user selects one of their favorites, the application sends a /lookup endpoint request using the id of the bookmarked location record.

For example, retrieving location details for Berlin Brandenburg Airport (Willy Brandt) using curl looks like :

curl -sD /dev/stderr "https://lookup.search.hereapi.com/v1/lookup?apiKey=$API_KEY
&id=here:pds:place:276u339g-0dd32a93728c47c3b35985e550f30a70"
| jq .

The API responds with:

HTTP/1.1 200 OK
X-Correlation-ID: 62233873-58c5-4cb0-afa0-67aca94a0dff
(...)
{
  "title": "Flughafen Berlin Brandenburg Willy Brandt",
  "id": "here:pds:place:276u339g-0dd32a93728c47c3b35985e550f30a70",
  "access": [{ "lat": 52.36447, "lng": 13.51003 }],
  ...
}

Be aware, that the X-Correlation-ID value is unique for each API response.

Example: Navigation Action

When an end user in Germany navigates to this location on Monday, December 5, 2022, at 09:56 (CEST), the application does the following:

  1. Collects the required attributes from the previous response payload, together with the ad hoc action.

    fieldvalue
    timestamp1670230588623
    correlationId26ff9c58-37b3-4a08-bc4e-a533a5ce3a15
    resourceIdhere:pds:place:276u339g-0dd32a93728c47c3b35985e550f30a70
    rank0
    actionhere:gs:action:navigate-to
  2. Sends a request to the /signals endpoint similar to the following:

    curl -sXPOST "https://signals.search.hereapi.com/v1/signals?apiKey=$API_KEY" -d @- << EOF
    version=1
    &timestamp=1670230588623
    &resourceId=here:pds:place:276u339g-0dd32a93728c47c3b35985e550f30a70
    &correlationId=62233873-58c5-4cb0-afa0-67aca94a0dff
    &rank=0
    &action=here:gs:action:navigate-to
    EOF

Navigation actions

Use here:gs:action:navigate-from when navigation starts between two search results.

  • Include the resourceId of the starting location in the navigate-from line.
  • Use the navigate-to line to specify the destination.
📘

Note

The /signals endpoint is released as RESTRICTED. See the privilege section in the feature maturity topic for more information.