Skip to main content

Query Task Status

💡 API calls require authentication. Refer to Interface Authentication for authentication

GET {apiPrefix}/queryTaskStatus

Query task execution status by task id

  • If task execution fails, the failure reason is returned synchronously
  • If task execution succeeds, the task ID, filename and download address are returned synchronously.
  • Besides success and failure, if the task has not finished processing, it will return waiting or processing

Request Parameters:

Parameter NameTypeDescriptionRequired
taskIdstringTask idYes

Determine interface processing status based on the code value in the return value. Task status description:

code valueDescription
InvalidTaskIdInvalid task id, indicates this task id is not returned by zoffice
TaskSuccessNotify (or ConvertSuccessNotify)Task processing succeeded
TaskFailNotify (or ConvertFailNotify)Task processing failed
TaskHandingNotifyTask is being processed

Normal Response 1 (Processing):

// When task is not finished, returns processing
{
"taskId": "86b5173f-1719-4cac-adc4-e2aa447335b9",
"code": "TaskHandingNotify",
"detail": null
}

Normal Response 2 (Processing Succeeded):

// Task execution succeeded, processing completed, returns success
{
"taskId": "86b5173f-1719-4cac-adc4-e2aa447335b9",
"code": "TaskSuccessNotify", // or ConvertSuccessNotify
"detail": {
"taskStatus": "SUCCESS",
"defaultDownloadPath": "/docs/publicapi/v1/download",
"contentId": "670f8eb4f05ce339db231c57",
"startTime": 1729072540043,
"endTime": 1729072820389,
"filename": "demo-docx.pdf"
}
}

Error Response (Task Failed):

{
"taskId": "695fbf6e-90d2-42ba-83d5-00e81e5e366e",
"code": "TaskFailNotify", // or ConvertFailNotify
"detail": {
"taskStatus": "FAIL"
}
}