Positioning API Developer's Guide

Constructing a Request

A typical request to the Positioning API includes the basic elements shown in the following table and, in addition, it may contain resource-specific parameters or data.

Table 1. Basic request elements
Element Value/Example Description
Base URL https://pos.ls.hereapi.com Production environment when you use an API Key or an authentication token. For more information, see Authentication Examples.
Legacy Base URL https://pos.api.here.com Production environment when you use an app_id/app_code pair. For more information, see Authentication Examples.
Path /positioning/v1/  
Resource

locate

HTTPS POST only, submit data in the body of the request

HTTP header field Content-Type: application/json Used in both requests and responses.
HTTP header field Content-Encoding: gzip Optional header, indicates gzip encoded request body content
Application Code - Legacy &app_code={YOUR_APP_CODE} Substitute your own unique app_code. For more information, see Authentication Examples.
Application Id - Legacy &app_id={YOUR_APP_ID} Substitute your own unique app_id. For more information, see Authentication Examples.
API Key &apiKey={YOUR_API_KEY} Substitute with your own unique apiKey. For more information, see Authentication Examples.
Here is an example of locate request, which uses the HTTP POST method:
https://pos.ls.hereapi.com/positioning/v1/locate?apiKey={YOUR_API_KEY}
The POST body is as follows
{
  "wlan": [{
  "mac": "36:68:95:1A:36:93",
  "powrx": -74
  }, {
  "mac": "18:64:72:B7:BC:B2",
  "powrx": -75
  },{
  "mac": "18:64:72:B7:89:21",
  "powrx": -76
  },{
  "mac": "18:64:72:B7:BC:B1",
  "powrx": -77
  },{
  "mac": "18:64:72:B7:B1:63",
  "powrx": -79
  }]
}
Note: This example uses a HERE API Key to authenticate your request. For information on other possible options, see Authentication Guide. For examples of how to use the other authentication options with the Positioning API, see Authentication Examples.