自 2021 年 1 月起,经典文件类型不再可用。您可以转换经典文件或下载 PDF 文件。了解更多

WData API Execute Query and get results

0

评论

2 条评论

  • Jeff Hickey

    Hi Nick Ryberg

    When you successfully Execute A Query, the response body is the query result entity QueryResultDto. An example success response can be found here. Below I've added the top portion of the example response that includes the ID in bold.

    {
      "body": {
        "bytesScanned": "integer",
        "columns": [
          {
            "name": "string",
            "type": "string"
          }
        ],
        "created": "string",
        "duration": "integer",
        "error": "string",
        "id": "string",
        ....

    This ID can then be used to poll the status with the Retrieve A Single Query Result and the Download A Query Result endpoints.

    0
  • Nick Ryberg

    Thanks Jeff Hickey - that worked - I was able to query status and then download the results - it would help to have a callout in the documentation that `id` maps to `queryResultId`. 

    queryResultId = result['body']['id']

    url = 'https://h.app.wdesk.com/s/wdata/prep/api/v1/queryresult/' + queryResultId

    r = requests.get(url, headers=headers)

    print(r.json())
    0

请先登录再写评论。