API Reference

Retrieve list of queries

Description

Returns a list of all non-temporary queries associated with the workspace. By default, these queries are ordered by their names, in ascending order.

GET /api/v1/query

🚧

Required OAuth Scopes:

No OAuth scopes are required to use this endpoint.

Parameters

ParameterInTypeRequiredDescription
limitqueryinteger(int32)falseThe number of queries to return, from 1 to 1000; by default, 1000
cursorquerystringfalseA paging cursor; if included, limit is ignored
offsetqueryinteger(int64)falseThe item to start with on the page, greater than or equal to 0; by default, 0
idsqueryreffalseA list of ids to filter the returned list by

Code Samples

curl -X GET https://h.app.wdesk.com/s/wdata/prep/api/v1/query  \ 
-H 'Accept: application/json' \ 
-H 'Authorization: Bearer {access-token}'
http GET https://h.app.wdesk.com/s/wdata/prep/api/v1/query  \ 
Accept:application/json \ 
Authorization:"Bearer {access-token}"
wget --method=GET "https://h.app.wdesk.com/s/wdata/prep/api/v1/query" \
 --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/query', headers = headers)

print(r.json())

Returns

200 - OK

Returns a JSON object with body and cursor properties.

  • body contains an array of QueryDto 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": [
    {
      "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",
      "lastRun": "string",
      "lastRunBy": "string",
      "name": "string",
      "parameters": [
        {
          "alias": "string",
          "choices": [
            {}
          ],
          "id": "string",
          "label": "string",
          "mode": "string",
          "name": "string",
          "overridable": "boolean",
          "reference": {},
          "selectListId": "string",
          "type": "string",
          "value": {}
        }
      ],
      "parentId": "string",
      "primaryQueryResultId": "string",
      "queryText": "string",
      "temporary": "boolean",
      "type": "string",
      "updated": "string",
      "userId": "string",
      "version": "integer"
    }
  ],
  "code": "integer",
  "cursor": "string"
}