API Reference

Execute a query

Description

Runs a query and immediately returns a query result entity, which has an ID that can be used to poll the status from the GET /queryresult method. A status of COMPLETED or ERROR indicates the query has completed.

POST /api/v1/queryresult

🚧

Required OAuth Scopes:

No OAuth scopes are required to use this endpoint.

Parameters

ParameterInTypeRequiredDescription
bodybodyQueryResultDtofalseThe representation of the created query

Body parameter example

{
  "isExplain": false,
  "parameters": {
    "property1": {},
    "property2": {}
  },
  "queryDto": {
    "definition": {
      "columns": [
        {
          "columnType": "integer",
          "name": "string"
        }
      ],
      "decimalPlaces": 16,
      "filters": [
        {
          "betweenValue": "string",
          "columnType": "integer",
          "exclude": false,
          "filter": "EQUAL",
          "filterValues": [
            "string"
          ],
          "name": "string",
          "value": "string"
        }
      ],
      "grandTotalEnabled": "ENABLED",
      "id": "string",
      "multipleHeaders": false,
      "pivotViewType": "CLASSIC",
      "rows": [
        {
          "name": "string",
          "type": "integer"
        }
      ],
      "sortColumns": [
        "string"
      ],
      "subtotalEnabled": "ENABLED",
      "values": [
        {
          "active": true,
          "aggregation": "sum",
          "columnType": "integer",
          "name": "string"
        }
      ]
    },
    "description": "string",
    "historyRevision": 0,
    "name": "string",
    "parameters": [
      {
        "alias": "string",
        "id": "string",
        "label": "string",
        "mode": "scalar",
        "name": "string",
        "selectListId": "string",
        "type": "string",
        "value": {}
      }
    ],
    "primaryQueryResultId": "string",
    "queryText": "string",
    "temporary": false,
    "type": "string"
  },
  "queryId": "string"
}

Code Samples

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

r = requests.post('https://h.app.wdesk.com/s/wdata/prep/api/v1/queryresult', headers = headers)

print(r.json())

Returns

201 - Created

Returns a JSON object with a body property, which contains a QueryResultDto object for the executed query.

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",
      "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"
    },
    "queryId": "string",
    "queryParameters": [
      {
        "alias": "string",
        "choices": [
          {}
        ],
        "id": "string",
        "label": "string",
        "mode": "string",
        "name": "string",
        "overridable": "boolean",
        "reference": {},
        "selectListId": "string",
        "type": "string",
        "value": {}
      }
    ],
    "queryText": "string",
    "rowsReturned": "integer",
    "size": "integer",
    "status": "string",
    "updated": "string",
    "userId": "string",
    "version": "integer"
  },
  "code": "integer"
}