Geovisualization Developer's Guide

Getting Authentication Credentials

This topic details the steps required to obtain HERE authentication credentials for use in your application.

Get a Geovisualization Access Token

To get an access token, you send an HTTP POST request with your app_id and app_code as parameters to the Geovisualization REST API and your HERE account credentials as a JSON object in the request body:

https://datalens.api.here.com/v1/sign_in?&app_id={YOUR_APP_ID}&app_code={YOUR_APP_CODE}
  
{
  "email": "{your email address}",
  "password": "{your password}"
}

The response will be a JSON object that contains a value called access_token:

{
  "updatedTime": 1452698114977,
  "kind": "datalens#access_token",
  "language": "en",
  "firstname": "Frank",
  "access_token": "4KGaSS2Cmlba7xBKM..."
  ...
}

You can also use the sign_in endpoint in the 01. User Authentication folder of our Postman collection. If you followed Using Postman you should have your email and password already set, if not, then add them under the Body tab of the endpoint.

If you followed Using Postman you should have your app_id and app_code already set, if not, then add them under the Headers tab of the endpoint.

Click the blue Send button and you will receive a response like the below, containing a new access_token:

Figure 1. Response containing access token

(The access_token above has been truncated for presentation purposes.)

Note: You will need to provide the refresh_token (line 15 in the figure above) to refresh the access token for the session as described below.

Refreshing Authentication Tokens

Access tokens are valid for 60 minutes. If you get the error message token expired, you can refresh the token by using the sign_in/refresh endpoint which you can find in the 01. User Authentication folder of our Postman collection.

Figure 2. Request to refresh access token
Figure 3. Reponse to a request to refresh access token

For more information on the endpoint signin/refresh, see Sign_in.