随着Flash的结束,传统文件类型将在2020年12月消失。为避免中断,请开始将文件过渡到下一代。 学到更多

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

请先登录再写评论。