View all methods
studio.queryRuns.results
Get results for a completed Data Studio query run. JSON responses are limited to 1000 rows. CSV responses download the full result set.
Facts
| Method | GET https://api.getdx.com/studio.queryRuns.results |
| Required scope | datacloud:query |
Arguments
Required arguments
| Name | Type | Description |
|---|---|---|
token |
Token |
Auth token passed as an HTTP header. |
id |
Text |
The query run ID returned by studio.queryRuns.execute. Legacy encoded IDs are also supported. |
Optional arguments
| Name | Type | Description |
|---|---|---|
format |
Text |
Output format. Use json for an inline response or csv for a file download redirect. Defaults to json. |
Usage info
- Call this endpoint after
studio.queryRuns.inforeportsstatus=succeeded. - If the query run is still queued or running, this method returns
409 Conflictwitherror=execution_not_completeand aRetry-After: 1header. - If the query run has failed, inspect the
errorfield onstudio.queryRuns.info. format=jsonreturns up to 1000 rows inline.format=csvresponds with303 See Otherand redirects to a presigned download URL. Usecurl -Lto follow the redirect.- Query results expire 30 days after the run finishes. Use
query_run.expires_atfromstudio.queryRuns.infoto determine the retention window.
Example request
To retrieve JSON results:
curl -X GET 'https://api.getdx.com/studio.queryRuns.results?id=r3jv7p0x4gk2' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer xxxx-xxxxxxxxx-xxxx'
To download the full result set as CSV:
curl -L 'https://api.getdx.com/studio.queryRuns.results?id=r3jv7p0x4gk2&format=csv' \
-H 'Authorization: Bearer xxxx-xxxxxxxxx-xxxx'
Example response
This is a typical JSON success response:
{
"ok": true,
"results": {
"columns": ["id", "name"],
"rows": [
["1", "api"],
["2", "web"]
]
}
}
Errors
This table lists the expected errors that this method could return. However, other errors can be returned in the case where the service is down or other unexpected factors affect processing. Callers should always check the value of the ok param in the response.
| Error | Description |
|---|---|
not_authed |
No authentication token provided. |
invalid_auth |
Some aspect of authentication cannot be validated. |
not_authorized |
The API token does not include the required datacloud:query scope. |
not_found |
No query run with that ID exists for the current account. |
execution_not_complete |
The query run has not completed successfully yet. |
expired |
The query run results have expired. |