Get results¶
GET/
Live Discover API · Query Run Results
Get the results of a query run.
Parameters¶
| Name | In | Type | Required | Description |
|---|---|---|---|---|
X-Correlation-ID | header | string (uuid) | No | Response header to correlate requests. |
X-Tenant-ID | header | string (uuid) | Yes | Tenant ID. |
runId | path | string (uuid) | Yes | Query run ID. |
pageSize | query | integer | No | Page size for Live Discover query run results. Default is 1000; max is 1000. |
pageTotal | query | boolean | No | Whether the number of pages should be calculated and returned in the response. |
pageFromKey | query | string | No | The key of the item from where to fetch a page. |
sort | query | array of string | No | Defines how to sort the data. Each item must match the pattern (^[^:]+$)|(^[^:]+:(asc|desc)$). |
Request samples¶
curl -X GET "https://api-<data-region>.central.sophos.com/live-discover/v1/queries/runs/<runId>/results" -H "Authorization: Bearer <access-token>" -H "X-Correlation-ID: <X-Correlation-ID>" -H "X-Tenant-ID: <tenant-id>"
import requests
response = requests.get(
"https://api-<data-region>.central.sophos.com/live-discover/v1/queries/runs/<runId>/results",
headers={
"Authorization": "Bearer <access-token>",
"X-Correlation-ID": "<X-Correlation-ID>",
"X-Tenant-ID": "<tenant-id>",
},
)
print(response.json())
$headers = @{
"Authorization" = "Bearer <access-token>"
"X-Correlation-ID" = "<X-Correlation-ID>"
"X-Tenant-ID" = "<tenant-id>"
}
Invoke-RestMethod -Method GET -Uri "https://api-<data-region>.central.sophos.com/live-discover/v1/queries/runs/<runId>/results" -Headers $headers
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
req, err := http.NewRequest("GET", "https://api-<data-region>.central.sophos.com/live-discover/v1/queries/runs/<runId>/results", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer <access-token>")
req.Header.Set("X-Correlation-ID", "<X-Correlation-ID>")
req.Header.Set("X-Tenant-ID", "<tenant-id>")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
const response = await fetch("https://api-<data-region>.central.sophos.com/live-discover/v1/queries/runs/<runId>/results", {
method: "GET",
headers: {
"Authorization": "Bearer <access-token>",
"X-Correlation-ID": "<X-Correlation-ID>",
"X-Tenant-ID": "<tenant-id>",
},
});
const data = await response.json();
console.log(data);
Responses¶
200 — Query run results.¶
Response fields
pagesobjectrequiredShow child attributesHide child attributes
fromKeystringThe key of the first item in the returned page.
nextKeystringThe key to use when fetching the next page.
sizeintegerrequiredThe size of the page being returned.
totalinteger(Optional) The total number of pages that exist, if pageTotal=true in the request.
itemsinteger(Optional) The total number of items on all the pages, if pageTotal=true was passed into the request.
maxSizeintegerrequiredThe maximum page size that can be requested.
metadataobjectrequiredMetadata for tabular data in
items.Show child attributesHide child attributes
columnsarray of objectrequiredList of columns.
Column metadata.
Show child attributesHide child attributes
namestringrequiredColumn name.
typestringrequiredData types of values returned in query results.
Must be one of:
Must be one of:
boolean, dateTime, double, integer, text.itemsarray of objectrequiredOrdered list of JSON objects, one for each row in the results for the SQL query. A row JSON object has one field for each column in the SQL query. The value of the field is the value of the column.
Single row in the query run results.
Show child attributesHide child attributes
endpointIdstring (uuid)requiredEndpoint ID.
hostnamestringrequiredEndpoint name.
Errors¶
| Status | Meaning |
|---|---|
403 | Forbidden. |
404 | Can't find query run. |
500 | Unexpected error. |
All error responses share the same shape — see the error response object.
See the guide for a narrative walkthrough of this API.