Geovisualization Developer's Guide

Editing a Query

To copy or change a query, make an authenticated GET request to the following resource, where {QUERY_ID} is the unique identifier of your query:
http://datalens.api.here.com/v1/queries/{QUERY_ID}?app_id={YOUR_APP_ID}&app_code={YOUR_APP_CODE}

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

You will receive a response body that contains metadata about the query in a JSON object, including the query source code (in the query property), and information such as the query ID, description and tags (if defined).

To change a query, copy the code inside the query property, edit it, and post it to the Geovisualization REST API as usual. See Creating a Query for details.

The response will be a JSON object containing the query result. It will look something like this:

{
  "origin": "user",
  "description": null,
  "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": "011f956a-42b9-4e23-ce02-af2e3002d0dc",
  "estimated_rows": 13
}