GuidesAPI Reference
Guides

How to use Single Shot Requests and Subscriptions

HERE GNSS API allows you to request data from HERE GNSS Service in two different modes.

Single Shot Request

When you make a single shot request, the service returns one response Message that contains the current data, such as the current navigation models of GPS satellites.

After the service has sent you the single response Message, the single shot request is finished.

If you don't make any other single shot requests or subscribe to data in this WebSocket connection, the connection closes after 60 seconds.

Subscription

When subscribing to data, you don't get back any data immediately, but when the data you subscribed to changes, each update to the data in turn changes the navigation models of GPS satellites.

The service keeps the connection open and continues sending the subscription data until you close the connection or unsubscribe from the data.

If the data you have subscribed to changes very slowly, the service sends WebSocket ping messages to keep the connection open. Your WebSocket library automatically answers with pong messages (if it has been implemented according to the WebSocket specification).

You can subscribe to many different data types in the same connection. In this case, each received Message may contain updates from several data types.

If your connection closes, for example, due to telecommunication problems, you must subscribe to data again after you reconnect to HERE GNSS Service. Use exponential backoff when trying to reconnect.