API Reference

Update a single query

Description

Updates the query that matches the provided ID with the details provided in the body.

PUT /api/v1/query/{queryId}

🚧

Required OAuth Scopes:

No OAuth scopes are required to use this endpoint.

Parameters

ParameterInTypeRequiredDescription
queryIdpathstringtrueThe unique identifier of the query
bodybodyQueryDtofalseThe representation of the query to update

Body parameter example

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

Code Samples

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

print(r.json())

Returns

200 - OK

Returns a JSON object with a body property, which contains a QueryDto object for the updated 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"
}