|
自 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

登入寫評論。