1Export Query Data
Overview
This API executes an SQL or MDX query against a Semantic Model and returns the results in the required format (JSON, CSV, or zipped).
Method: POST
Request URL: {kyvos-url}/v2/exports/query-data
Authorization
API Key: sessionid
This method authenticates requests using a session ID which acts like an API key.
BasicAuth: HTTP Authorization Scheme
This method authenticates requests using a username and password sent in the HTTP Authorization header.
Headers
Header Name | Type | Description | Possible Values |
|---|---|---|---|
Content-Type (Required) | String | Specifies media type of request body. |
|
Accept | String | Specifies media type of response body. |
|
sessionid | String | The session ID is the token received from the login API. Note: Session ID is required for token-based authentication. | – |
Request Body
Parameter Name | Type | Description | Possible Values |
|---|---|---|---|
queryType (Required) | String | Type of query to execute. |
|
query (Required) | String | The SQL or MDX query string to be executed. | – |
outputFormat (Required) | String | Format in which the data should be exported. Note: Required when Accept header is When Accept is |
|
folderName | String | Name of the folder where Semantic Model is present, If the Semantic Model is present in the root directory, specify [Root]. Note: If folderName is not provided, the Semantic Model will be treated as a root-level entity by default. | – |
smodelName | String | Name of the Semantic Model to execute the query against. | – |
zipped | String | Whether the response should be zipped. Note: Only applicable when Accept is Ignored (forced to |
|
outputFileName | String | Custom file name for the exported data. If not provided, a default name is generated. Note: The file extension (.json, .csv, or .zip) is appended automatically based on outputFormat and zipped. | – |
keepMeasureFormatting | String | Whether to preserve measure formatting in the exported data. |
|
tabularViewType | String | The tabular view type for the query results. |
|
columnHeaderSeparator | String | Custom separator for column header values. Used to separate hierarchical column names in the exported output.. | Default: |
maxRows | String | Maximum number of rows to include in the response. Must be a valid integer. If not provided, no row limit is applied. | – |
maxColumns | String | Maximum number of columns to include in the response. Must be a valid integer. If not provided, no column limit is applied. | – |
requestID | String | Custom request ID for logging and tracing. If provided, it overrides the auto-generated request ID in the logger context. Also used for sending cancel requests on timeout. | – |
lineSeparator | String | Line separator character(s) used while exporting data to a file. | Default: |
fieldSeparator | String | Delimiter character used for separating fields in CSV output. | Default: |
enclosedBy | String | Character used for enclosing field values in CSV output. | Default: |
includeHeader | String | Whether to include header information in the exported file. |
|
Responses
200 OK
The query is executed successfully, and the results are returned in the requested format.Error Responses
Status Code | Description |
|---|---|
401 | Authorization information is missing or invalid. |
404 | No matching record found. |
412 | Precondition failed. Parameter missing. |
500 | Internal Server Error. |