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:
-
Collects the required attributes from the previous response payload, together with the ad hoc action.
field value timestamp1670230588623correlationId26ff9c58-37b3-4a08-bc4e-a533a5ce3a15resourceIdhere:pds:place:276u339g-0dd32a93728c47c3b35985e550f30a70rank0actionhere:gs:action:navigate-to -
Sends a request to the
/signalsendpoint similar to the following:curl -sXPOST "https://signals.search.hereapi.com/v1/signals?apiKey=$API_KEY" -d @- << EOF version=1 ×tamp=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
resourceIdof the starting location in thenavigate-fromline. - Use the
navigate-toline to specify the destination.
Note
The
/signalsendpoint is released as RESTRICTED. See the privilege section in the feature maturity topic for more information.
Updated last month