Get Query Task Results¶
GET /api/v1/logmine/query_task
Overview¶
Poll the Pattern task status and read the masked Pattern results after completion.
Before You Begin and Usage Steps¶
Use the Key of the target workspace. Either the routine.defaultAccess or anonymous.snapshotShared entry permission is required. Poll using taskId in the GET Query. The Query whitelist allows only taskId; do not add cross-workspace, index, limit, or URL body parameters. Result processing is still subject to data access and masking context constraints.
taskId must be the actual return value of Send Query Task. Poll promptly using a Key from the same workspace. When the task is not yet complete, empty data and docCount of 0 are placeholders and must not be treated as final no-data. Read results only when taskStatus is strictly equal to ok; other status strings and error come from the task service and should be handled according to their actual progress/failure meaning. Do not retry all non-ok statuses indefinitely. It is recommended to use polling backoff, set a client-side deadline, and save completed results.
Completed results are formatted according to the field/data access configuration saved at creation time and the current sensitive field rules; in a normal OpenAPI response, message is text concatenated from selected string fields, not the original JSON object. Nonexistent fields are not automatically filled in, non-string values are skipped, and some content may be masked. docids are the original document identifiers returned by the task service, not resource UUIDs that can be submitted directly to arbitrary delete/modify APIs. count/docCount only describe processing results; they do not prove that the time window is fully covered or whether truncation occurred before the limit was reached.
The cache context is retained for only 20 minutes, and normal polling does not renew it; even if the task service still has results, an expired or missing context returns a query timeout 406, and masking cannot be bypassed for direct reading. A waiting status may still return 200 when the cache is missing, and validation is triggered only upon completion; do not use this difference to determine that task ownership has been verified. no_index_list is a sentinel that directly returns an empty result locally, containing taskStatus=ok/data=[]/docCount=0, but no processingLimit/timeRange; it does not mean that a query was performed.
Request Headers¶
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| DF-API-KEY | string | Y | OpenAPI authentication credential for the workspace. Example: <DF-API-KEY>How to obtain or enter: Obtain an OpenAPI Key with this operation permission from API Key Management in the target workspace. |
Query Request Parameters¶
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| taskId | string | Y | Required string; do not use traceId or create an ID yourself. no_index_list is a no-index sentinel, not a remote task. Example: logmine_task_exampleHow to obtain or enter: Use content.taskId from Send Query Task in the same workspace. |
Request Example¶
curl --get 'https://openapi.guance.com/api/v1/logmine/query_task' \
-H 'DF-API-KEY: <DF-API-KEY>' \
--data-urlencode taskId=logmine_task_example
Response¶
HTTP 200, application/json. The example below shows the main fields that can be read directly.
| Field | Type | Description |
|---|---|---|
| content.taskStatus | string | Non-empty status from the task service returned as-is; ok means to retrieve results, and other statuses are not forced into a fixed enumeration. |
| content.data | array | List of Pattern groups when complete; empty when incomplete/no index; this is not pagination, and pageInfo does not exist. |
| content.data[] | object | A group of approximate text clusters; additional fields are returned as provided by the task service. |
| content.data[].count | integer | Number of documents matched/processed by this group, returned by the task service. |
| content.data[].docids | array | List of document identifiers for this group; elements are usually strings. |
| content.data[].message | string | Concatenated text after field extraction and masking; may be empty; no longer the original message JSON. |
| content.docCount | integer | Number of analyzed documents returned by the task service; defaults to 0 when incomplete/no index; this is not proof of the total number of matches across the full window. |
| content.progress | JSON | Progress passed through when provided by the upstream; format is not fixed and may be absent. |
| content.error | JSON | Error information passed through when provided by the upstream; even with HTTP 200, check the task status and this field. |
| content.processingLimit | integer or null | Returned only when saved in the creation cache; historical/no-index sentinels may omit it. Do not use the current configuration as a substitute for the creation-time limit. |
| content.timeRange | array | Original request range returned when this key exists in the creation cache; may be absent. |
| content.declaration | object or null | Workspace public declaration attached to a non-empty business object; may be null or an empty object when not configured; empty objects are not added. |
{
"code": 200,
"content": {
"taskStatus": "ok",
"data": [
{
"count": 2,
"docids": [
"DOC-ID-1",
"DOC-ID-2"
],
"message": " upstream request * failed"
}
],
"docCount": 2,
"processingLimit": 10000,
"timeRange": [
1785427200000,
1785429000000
],
"declaration": {}
},
"errorCode": "",
"message": "",
"success": true,
"traceId": "TRACE-EXAMPLE"
}
Example of a task in progress (progress types and status text are based on the actual upstream response and do not constitute a fixed enumeration):
{
"code": 200,
"content": {
"taskStatus": "running",
"data": [],
"docCount": 0,
"progress": 0.5,
"processingLimit": 10000,
"timeRange": [
1785427200000,
1785429000000
],
"declaration": {}
},
"errorCode": "",
"message": "",
"success": true,
"traceId": "TRACE-EXAMPLE"
}
Error Responses¶
For authentication, rate limiting, and common request errors, see Common Error Definitions.
The task service may return dynamic data query/permission errors; handle them according to the actual HTTP status and error body. 5xx responses without a pass-through marker are uniformly converted to HTTP 500 ft.InternalServerError; do not assume that all upstream codes are exposed as-is. HTTP 200 with success=true only indicates that this submission/polling API call succeeded; it does not mean that the asynchronous Pattern task has completed.
| HTTP Status | errorCode | Trigger Condition | Message or Response Description | Handling |
|---|---|---|---|---|
| 406 | ft.ParameterValidationFailed | Using an undeclared Query parameter or a parameter that violates the rules | Parameter parsing failed | Check the Query parameter table and examples. |
| 406 | ft.FrontRequestTimeout | Task is ok but the masking context cache from creation is missing or expired | Query timeout | Resubmit a small-range task with the original parameters and poll promptly; do not expect repeated polling of the old ID to restore the cache. |
| 406 | ft.InvalidParameter | Field or data domain in the cache is not a valid structure | Parameter {} is invalid |
Stop repeatedly querying the old ID; contact the administrator to check cache compatibility, then create a new one. |
| 500 | ft.InternalServerError | Task status is not a non-empty string, the task service returns 5xx, or the returned message/cache JSON format is abnormal | Internal error | Retain traceId and taskId; avoid determining that results are complete based solely on HTTP 200 or the task's existence. |