Query Runner

Get Query Results

Changed on

Fetches the latest status for a submitted query and, once complete, returns fields and paginated results.

This endpoint is the second step of the query-runner flow. First call POST /api/connections/{connection_id}/query, then poll this endpoint with the returned ID.

Results may be paginated across multiple blobs. When that happens, use the opaque links.next and links.previous URLs exactly as returned. Do not try to construct the page token yourself.

If the query is still running, the response may include only status metadata. The terminal statuses are done, failed, and unknown. An unknown status means execution started, but its durable terminal result was lost or expired. Stop polling when you receive any terminal status.

If the task is complete but the caller is not the same user that created it, the endpoint returns 404.

get/api/queries/{id}

Request

  • Base URL
    https://app.polytomic.com
  • Auth
    • HTTP bearer
    • or HTTP basic

Path parameters

idstring uuid required

Unique identifier of the query task, as returned by POST /api/connections/{connection_id}/query

Example:248df4b7-aa70-47b8-a036-33ac447e668d

Query parameters

pagestring

Opaque pagination token returned in the links.next or links.previous URL of the previous response

Headers

X-Polytomic-Versionstring
X-Polytomic-Harbor-Sessionstring

Harbor session token; when supplied, the session must be active and bound to this credential and Harbor.

X-Polytomic-Activity-Request-IDstring

New nonzero UUID for each request, required for scoped credentials; a reused value is rejected.

Response

OK

Example response

{
  "data": {
    "count": 10,
    "expires": "2021-01-01T00:00:00Z",
    "fields": [
      "name",
      "age"
    ],
    "id": "43d893ef-322b-47da-badb-3cf10d13a556"
  },
  "links": {
    "next": "/api/queries/43d893ef-322b-47da-badb-3cf10d13a556?page=MQ%3D%3D"
  }
}

Changes

    • breaking

      the response's property type changed from object to no type for status

    • breaking

      the response's property type changed from object to no type for status

    • warning

      removed the optional property / from the response with the status

    • warning

      removed the optional property / from the response with the status

    • warning

      removed the optional property / from the response with the status

    • warning

      removed the optional property / from the response with the status

    • warning

      removed the optional property / from the response with the status

    • warning

      removed the optional property / from the response with the status

    • warning

      removed the optional property / from the response with the status

    • warning

      removed the optional property / from the response with the status

    • warning

      removed the optional property / from the response with the status

    • info

      added to the response property allOf list for the response status

    • info

      added to the response property allOf list for the response status

    • breaking

      the / response's property type changed from string to no type for status

    • info

      added to the / response property allOf list for the response status

    • info

      removed the created enum value from the / response property for the response status

    • info

      removed the done enum value from the / response property for the response status

    • info

      removed the failed enum value from the / response property for the response status

    • info

      removed the running enum value from the / response property for the response status

    • info

      removed the unknown enum value from the / response property for the response status