Send data to the cloud

Your user account now has access to the data reported by the device. The next step is for the device to report data.

If you are using one of the sample HERE Tracker applications (Android, C), you may already be seeing data via the Tracking API. The following examples show what those applications are doing and allow you to do it manually yourself.

Send data to the Tracking API

Prerequisites

  • Valid deviceId and deviceSecret for a device that has been claimed to a user project

Log in device

For additional details, see the Tracking API.

curl -X POST \
  https://tracking.api.here.com/v2/token
  -H 'Authorization: OAuth {signedRequest}'

You will receive an accessToken for the device. In this guide, we will refer to this as the deviceToken. If you receive an error "412 Precondition Failed", it means the device has not been claimed to a project yet. See the previous section for details on how to claim a device.

Send data

Send the data to HERE Tracking using the ingestion endpoint:

curl -X POST \
  https://tracking.api.here.com/v2/ \
  -H 'Authorization: Bearer {deviceToken}' \
  -H 'Content-Type: application/json' \
  -d '[{
  "timestamp": 1569246158000,
  "position": {
      "lat": 52.5,
      "lng": 13.4,
      "alt": 1,
      "accuracy": 10
  }
}]'

You will receive the device's desired shadow.

NOTE: The timestamp is the UNIX Epoch time in milliseconds.

results matching ""

    No results matching ""