Geovisualization Developer's Guide

Creating a Query

To create a new query, you first need to define a JSON object that contains the query code, and then POST it to the Geo-visualization REST API. See Define Query for details on defining queries.

Once you have defined a query, include the query code as the request body in an authenticated POST to the following resource:

https://datalens.api.here.com/v1/queries?app_id={YOUR_APP_ID}&app_code={YOUR_APP_CODE}

You will receive a response body that includes the new query ID inside a JSON object with metadata about the query, including its source code.

You can also use the queries endpoint in the 07. Query CRUD folder of our Postman collection.

You will receive a response body that includes the new query ID inside a JSON object that also contains metadata about the query, including its source code.

The response will look something like this:

{
  "origin": "user",
  "description": "Earthquake data from 2012 - Absolute value of depths",
  "tags": [],
  "updated_at": "2017-02-10T14:33:50Z",
  "visibility": "private",
  "dataset": "90af668484394fa782cc103409cafe39",
  "query": {
  "metrics": [
    "avg_magnitude",
    "count"
  ],
  "facets": [
    "Src"
  ],
  "namespace": {
    "count": {
    "source": [
      "region"
    ],
    "apply": [{
      "type": "aggregate",
      "fn": "count"
    }]
    },
    "avg_magnitude": {
    "source": [
      "Magnitude"
    ],
    "apply": [{
      "type": "aggregate",
      "fn": "average"
    }]
    }
  },
  "order": [{
    "Src": "asc"
    },
    {
    "count": "desc"
    }
  ],
  "dataset": "90af668484394fa782cc103409cafe39"
  },
  "id": "6fad8374f8bc4470b1d71f802cc5537d",
  "kind": "datalens#query",
  "created_at": "2017-02-10T14:33:50Z",
  "request_id": "5c447143-9682-4ae4-ca62-e09ce038e318",
  "estimated_rows": 13
}
Note: The value for the id field is the unique identifier for the new query. You reference this ID in a JavaScript service to fetch the query results in your visualizations.

You cannot use this account to purchase a commercial plan on Developer Portal, as it is already associated to plans with different payment methods.

To purchase a commercial plan on Developer Portal, please register for or sign in with a different HERE Account.

Something took longer than expected.

The project should be available soon under your projects page.

Sorry, our services are not available in this region.

Something seems to have gone wrong. Please try again later.

We've detected that your account is set to Australian Dollars (AUD).
Unfortunately, we do not offer checkouts in AUD anymore.
You can continue using your current plan as normal, but to subscribe to one of our new plans,
please register for a new HERE account or contact us for billing questions on selfservesupport@here.com.