Geovisualization Developer's Guide

Publishing a Query

After you create a query, it is "private" by default. This means that only query owners can request the query results. You can allow access to your query to unauthenticated users when you want to publish a visualization that uses the query.

To publish one or more queries, define a JSON request body containing the IDs of the queries to make public:

{
  "queries": {
    "visibility": "public",
    "ids": [
      "QUERY_ID_1",
      "QUERY_ID_2",
      "QUERY_ID_3"
     ]
  }
}

You then send this in an authenticated POST request to:

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

You can also use the publishing endpoint in the 12. Publish Queries folder of our Postman collection.

The response will look something like this:

{
  "queries": {
    "ids": [
      "0ba17e521ea1472db51a8cfc09fc1155"
    ],
    "visibility": "public"
  }
}

You can set a query to private by sending the same request above with the visibility property set to private.

Note: If you do not want to make your queries public for your application, you can authenticate with JavaScript inside your app, read here for instructions.