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 in HERE Tracking. The following examples show what those applications are doing and allow you to do it manually yourself.

Send data to HERE Tracking

Prerequisites

  • Valid deviceId and deviceSecret for a device that has been added to a user account

Log in device

Follow the documentation for details on how to generate a signed OAuth 1.0 request.

curl -X POST \
  https://tracking.api.here.com/v2/token
  -H 'Authorization: Bearer {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

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 updated shadow. Note that timestamp is milliseconds since Epoch timestamp.

results matching ""

    No results matching ""