Retrieve a list of query results

Retrieve a list of query results#

Description#

Returns a paged list of query results that match the provided query ID, or an empty list if no matching query is found.

GET /api/v1/queryresult

Required OAuth Scopes

No OAuth scopes are required to use this endpoint.

Parameters#

Parameter

In

Type

Required

Description

queryId

query

string

true

The unique identifier of the query

userSpecific

query

boolean

false

Limit results to those created by the current user

cursor

query

string

false

A paging cursor; if included, limit is ignored

limit

query

string

false

The number of query results to return, from 1 to 1000; by default, 1000

offset

query

integer(int64)

false

The item to start with on the page, greater than or equal to 0; by default, 0

Code Samples#

curl -X GET https://h.app.wdesk.com/s/wdata/prep/api/v1/queryresult \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer {access-token}' \
    -G \
    --data-urlencoded "queryId=string"
http GET https://h.app.wdesk.com/s/wdata/prep/api/v1/queryresult \
    Accept:application/json \
    Authorization:"Bearer {access-token}" \
    queryId==string
wget --method=GET "https://h.app.wdesk.com/s/wdata/prep/api/v1/queryresult?queryId=string" \
    --output-document -  \ 
    --header 'Accept: application/json' \ 
    --header 'Authorization: Bearer {access-token}'
import requests

headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('https://h.app.wdesk.com/s/wdata/prep/api/v1/queryresult', params={
  'queryId': 'string'
}, headers = headers)

print(r.json())

Returns#

200 - OK#

Returns a JSON object with body and cursor properties.

  • body contains an array of QueryResultDto objects. If the request returns no results, body contains an empty array.

  • cursor contains a paging cursor, which can be included in the next call to the endpoint to retrieve the next set of results. If no additional results, cursor is null.

Example Responses#

{
  "body": [
    {
      "bytesScanned": "integer",
      "columns": [
        {
          "name": "string",
          "type": "string"
        }
      ],
      "created": "string",
      "duration": "integer",
      "error": "string",
      "id": "string",
      "isExplain": "boolean",
      "parameters": {},
      "pivotStatus": "string",
      "queryDto": {
        "created": "string",
        "definition": {
          "columns": [
            {
              "columnType": "string",
              "name": "string"
            }
          ],
          "decimalPlaces": "integer",
          "filters": [
            {
              "betweenValue": "string",
              "columnType": "string",
              "exclude": "boolean",
              "filter": "string",
              "filterValues": [
                "string"
              ],
              "name": "string",
              "value": "string"
            }
          ],
          "grandTotalEnabled": "string",
          "id": "string",
          "multipleHeaders": "boolean",
          "pivotViewType": "string",
          "rows": [
            {
              "name": "string",
              "type": "string"
            }
          ],
          "sortColumns": [
            "string"
          ],
          "subtotalEnabled": "string",
          "values": [
            {
              "active": "boolean",
              "aggregation": "string",
              "columnType": "string",
              "name": "string"
            }
          ]
        },
        "dependencies": [
          {
            "databaseId": "string",
            "system": "string",
            "tableId": "string"
          }
        ],
        "description": "string",
        "historyRevision": "integer",
        "id": "string",
        "isShared": "boolean",
        "lastRun": "string",
        "lastRunBy": "string",
        "name": "string",
        "parameters": [
          {
            "alias": "string",
            "choices": [
              "undefined"
            ],
            "id": "string",
            "label": "string",
            "listType": "string",
            "mode": "string",
            "name": "string",
            "overridable": "boolean",
            "reference": "undefined",
            "selectListId": "string",
            "type": "string",
            "value": "undefined"
          }
        ],
        "parentId": "string",
        "primaryQueryResultId": "string",
        "queryText": "string",
        "temporary": "boolean",
        "type": "string",
        "updated": "string",
        "userId": "string",
        "version": "integer"
      },
      "queryId": "string",
      "queryParameters": [
        {
          "alias": "string",
          "choices": [
            "undefined"
          ],
          "id": "string",
          "label": "string",
          "listType": "string",
          "mode": "string",
          "name": "string",
          "overridable": "boolean",
          "reference": "undefined",
          "selectListId": "string",
          "type": "string",
          "value": "undefined"
        }
      ],
      "queryText": "string",
      "rowsReturned": "integer",
      "size": "integer",
      "status": "string",
      "updated": "string",
      "userId": "string",
      "version": "integer"
    }
  ],
  "code": "integer",
  "cursor": "string"
}