API Reference

Preview a query

Description

Creates a limited scope query object, but does not execute it. The query selects all values against the provided table, up to 10 rows. This endpoint may allow unpermissioned users to preview table data; full permissions to datasources are not validated.

POST /api/v1/query/preview/{tableId}

🚧

Required OAuth Scopes:

No OAuth scopes are required to use this endpoint.

Parameters

ParameterInTypeRequiredDescription
tableIdpathstringtrueThe identifier of the table to query
limitqueryinteger(int32)falseThe number of rows to return
fileNamequerystringfalseThe name of the file to create

Code Samples

curl -X POST https://h.app.wdesk.com/s/wdata/prep/api/v1/query/preview/{tableId}  \ 
-H 'Accept: application/json' \ 
-H 'Authorization: Bearer {access-token}'
http POST https://h.app.wdesk.com/s/wdata/prep/api/v1/query/preview/{tableId}  \ 
Accept:application/json \ 
Authorization:"Bearer {access-token}"
wget --method=POST "https://h.app.wdesk.com/s/wdata/prep/api/v1/query/preview/{tableId}" \
 --output-document -  \ 
 --header 'Accept: application/json' \ 
 --header 'Authorization: Bearer {access-token}'
import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('https://h.app.wdesk.com/s/wdata/prep/api/v1/query/preview/{tableId}', headers = headers)

print(r.json())

Returns

201 - Created

Returns a JSON object with a body property, which contains a QueryDto object for the created query.

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"
}