Description
Exports a query result with the provided ID to Spreadsheets. To determine where to export the results, the request body should include a URL copied and pasted from the Spreadsheets UI. Returns a 404 if no matching query result is found.
POST
/api/v1/queryresult/{queryResultId}/export
Required OAuth Scopes:
No OAuth scopes are required to use this endpoint.
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
queryResultId | path | string | true | The unique identifier of the query result |
body | body | ExportQueryResultDto | true | The representation of the export query result |
Body parameter example
{
"exportAsDataset": false,
"url": "string",
"useFlatKey": false
}
Code Samples
curl -X POST https://h.app.wdesk.com/s/wdata/prep/api/v1/queryresult/{queryResultId}/export \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
http POST https://h.app.wdesk.com/s/wdata/prep/api/v1/queryresult/{queryResultId}/export \
Content-Type:application/json \
Accept:application/json \
Authorization:"Bearer {access-token}"
wget --method=POST "https://h.app.wdesk.com/s/wdata/prep/api/v1/queryresult/{queryResultId}/export" \
--output-document - \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {access-token}'
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('https://h.app.wdesk.com/s/wdata/prep/api/v1/queryresult/{queryResultId}/export', headers = headers)
print(r.json())
Returns
201 - Created
Returns a JSON object containing a body
property, which contains the ID of the exported query result.
Example Responses
{
"body": "string",
"code": "integer"
}