Skip to content

API Reference

EQQ exposes a REST API that lets external applications execute queries, export results, and render charts — the same operations available in the UI, accessible over HTTP.

Use the Query To JSON builder to generate snippets

Data Visualization → Query To JSON generates a ready-to-use cURL command for any query. Use this page as a reference when building integrations programmatically.


Authentication

Every API request must include one of:

Method Header Value
API Key (recommended) X-API-Key eqq_live_… key from My Account → API Keys
Basic Auth Authorization BASIC <base64(username:password)>

API keys inherit the issuing user's role permissions and database scope. Up to 5 active keys per user; generate and revoke under My Account → API Keys.


Execute Query — JSON

Returns query results as a JSON array, with optional server-side paging.

POST /api/v1/JsonBuilder/ExecuteQuery

Request headers

Header Required Description
Authorization or X-API-Key Yes See Authentication above
Content-Type Yes application/json
RowIndex No Zero-based row offset for paging (default: 0)
RowSize No Page size — number of rows to return (default: server setting)
QueryMoreCode No Continuation token from a previous response for the next page

Request body

{
  "QueryName": "Demo_All_customers_and_the_items_they_ordered",
  "Parameters": [
    { "ParameterName": "@CustomerId", "Value": "42",   "DataType": "int" },
    { "ParameterName": "@FromDate",   "Value": "2024-01-01", "DataType": "datetime" }
  ]
}
Field Type Description
QueryName string Technical name of an Active query
Parameters array One object per declared parameter; omit optional ones
Parameters[].ParameterName string Exact @Name from the query definition
Parameters[].Value string Value as a string (EQQ casts to DataType)
Parameters[].DataType string SQL type hint: nvarchar, int, datetime, bit, …

Response

{
  "Data": [
    { "CustomerName": "Acme Corp", "ItemName": "Widget A", "Qty": 10 },
    { "CustomerName": "Beta LLC",  "ItemName": "Widget B", "Qty": 5  }
  ],
  "RowSize": 100,
  "NextRowIndex": 100,
  "QueryMoreCode": "eyJDb21tYW5kTmFtZSI6InBRUV8..."
}
Field Description
Data Array of result row objects. Keys are the query's display column names.
RowSize Page size used for this response.
NextRowIndex Row offset to pass as RowIndex on the next call.
QueryMoreCode Opaque continuation token — pass as QueryMoreCode header to fetch the next page. null when no more rows remain.

Paging example

# Page 1
curl --location 'https://my-sample-eqq.com/api/v1/JsonBuilder/ExecuteQuery' \
  --header 'X-API-Key: eqq_live_9f8c2a...' \
  --header 'Content-Type: application/json' \
  --header 'RowSize: 100' \
  --data '{"QueryName":"Demo_All_Customers","Parameters":[]}'

# Page 2 — use QueryMoreCode and NextRowIndex from page 1 response
curl --location 'https://my-sample-eqq.com/api/v1/JsonBuilder/ExecuteQuery' \
  --header 'X-API-Key: eqq_live_9f8c2a...' \
  --header 'Content-Type: application/json' \
  --header 'RowSize: 100' \
  --header 'RowIndex: 100' \
  --header 'QueryMoreCode: eyJDb21tYW5kTmFtZSI6...' \
  --data '{"QueryName":"Demo_All_Customers","Parameters":[]}'

Execute Query — Chart Data

Returns the same data as Execute Query but with column-type metadata (categorical vs numeric) pre-classified for chart rendering.

POST /api/v1/JsonBuilder/ExecuteQueryChart

Request body is identical to Execute Query. Paging headers (RowIndex, RowSize, QueryMoreCode) are supported.

Response adds column classification alongside Data:

{
  "Data": [  ],
  "RowSize": 100,
  "QueryMoreCode": null,
  "Columns": [
    { "Name": "CustomerName", "Type": "categorical" },
    { "Name": "TotalRevenue",  "Type": "numeric" }
  ]
}

Embed Chart URL (Extended Edition)

Generates a signed, time-limited token that renders a chart in an <iframe> without requiring the viewer to log in.

GET /api/v1/EmbeddedChart/GenerateToken

Query parameters

Parameter Required Description
queryName Yes Technical name of an Active query
parameters No URL-encoded JSON array of parameter objects (same shape as Execute Query body)
chartType Yes bar, line, pie, donut, area
labelColumn Yes Column name for the X axis / labels
dataColumn Yes Column name for the Y axis / values
expirationDays No Token lifetime in days (default: 7)
title No Chart title string
chartHeight No Height in pixels (default: 400)
showToolbar No true / false
showDataLabels No true / false
showGrid No true / false

Response

{ "Token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." }

Render the chart

GET /api/v1/EmbeddedChart/RenderByToken?token=<token>

Returns an HTML page with the rendered chart — suitable as an <iframe> src:

<iframe
  src="https://my-sample-eqq.com/api/v1/EmbeddedChart/RenderByToken?token=eyJ..."
  width="100%" height="450" frameborder="0">
</iframe>

Error responses

All endpoints return standard HTTP status codes.

Status Meaning
200 OK Success
400 Bad Request Missing required field or invalid parameter value
401 Unauthorized Missing, expired, or revoked credential
403 Forbidden Credential valid but query not accessible to this user/role
500 Internal Server Error Query execution failed (SQL error, timeout, etc.) — check App_Data/Logs/error.log

Error body:

{ "Message": "Query 'MyQuery' not found or not Active for the current database." }