Create a device license

To create a new device license, you must be a user and have a project. You also need to be the project admin. This means that you have either created a new project through admin.tracking.here.com or you have been granted a membership of an existing project with a Project Admin role. Each project has a unique appId which is needed for provisioning a new device license.

In HERE Tracking, a user possessing a provisioned device license, is referred to as the device vendor.

Creating a license

Prerequisites

  • A HERE account obtained at account.here.com
  • A valid project

Log in

curl -X POST \
  https://tracking.api.here.com/users/v2/login \
  -H 'Content-Type: application/json' \
  -d '{
    "email": "{userEmail}",
    "password": "{userPassword}"
}'

This will return a user access token: accessToken.

Get project's application id

curl -X GET \
  'https://tracking.api.here.com/registry/v2/licenses' \
  -H 'Authorization: Bearer {accessToken}' \
  -H 'Content-Type: application/json'

This will return a list of projects you are member of. Each project has a unique appId and projectId. Pick an appId and projectId of a project you want to add the device to. In this guide, we will refer to these parameters as the projectAppId and projectId.

Request a single device license

You can request one single device license using this request

curl -X POST \
  https://tracking.api.here.com/registry/v2/{projectAppId}/one-device \
  -H 'Authorization: Bearer {accessToken}' \
  -H 'Content-Type: application/json'

This will return the requested device license – a deviceId and deviceSecret.

Request multiple device licenses

Alternatively, you can request multiple device licenses for multiple devices simultaneously. The count parameter specifies the number of licenses requested. For evaluation purposes, you can create a maximum of 10 device licenses.

Create device license job

curl -X POST \
  https://tracking.api.here.com/registry/v2/{projectAppId}/devices \
  -H 'Authorization: Bearer {accessToken}' \
  -H 'Content-Type: application/json' \
  -d '{
    "count": 5
}'

This will return a jobId which can be used to track the progress of the license creation. For a small number of devices, this will be almost instantaneous.

Check job progress

curl -X GET \
  'https://tracking.api.here.com/registry/v2/{jobId}/status' \
  -H 'Authorization: Bearer {accessToken}' \
  -H 'Content-Type: application/json'

This will return a percentage showing the progress of the license creation batch job.

Retrieve licenses

curl -X GET \
  'https://tracking.api.here.com/registry/v2/{jobId}/results' \
  -H 'Authorization: Bearer {accessToken}' \
  -H 'Content-Type: application/json'

This will return the device licenses requested.

List all provisioned devices

curl -X GET \
  https://tracking.api.here.com/registry/v2/{projectAppId}/devices \
  -H 'Authorization: Bearer {accessToken}' \
  -H 'Content-Type: application/json'

This will list all the devices provisioned by a user project identified by the projectAppId.

results matching ""

    No results matching ""