Updated on 2024-07-30 GMT+08:00

Querying an Asynchronous Task

Function

Query details about an asynchronous task.

URI

POST /koodrive/ose/v1/share/taskDetail

Request Parameters

Table 1 Request header parameters

Parameter

Mandatory

Type

Description

Authorization

Yes

String

Access token. Token authentication is used to call KooDrive APIs. A token indicates the permission. When an API is called, the token is added to the request header to obtain the operation permission. For details about how to obtain an access token, see the corresponding developer guide. The format is Bearer+{access_token}.

X-Traceid

No

String

Service trace ID, which contains 58 bits.

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

taskId

Yes

String

Task ID.

shareId

Yes

String

Sharing ID.

kdstoken

No

String

token

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

code

String

Response code.

msg

String

Response information.

taskInfo

TaskInfo object

Asynchronous task information.

Table 4 TaskInfo

Parameter

Type

Description

userId

String

User ID.

taskId

String

Task ID.

taskType

Integer

Task type.

taskStatus

Integer

Task status. 0: to be processed; 1: being processed; 2: completed; 3: canceled.

taskResultCode

Integer

Task result. 1: all succeeded; 2: partially failed; 3: all failed.

resultCode

Integer

Task content processing result.

createTime

String

Task creation time. The value is a 14-digit timestamp in yyyyMMddHHmmss format.

startTime

String

Task start time. The value is a 14-digit timestamp in yyyyMMddHHmmss format.

endTime

String

Task end time. The value is a 14-digit timestamp in yyyyMMddHHmmss format.

progress

Integer

Task progress, in percentage. For example, if the progress is 70%, the returned value is 70.

downloadUrl

String

Download link of the compressed package.

Example Requests

POST /koodrive/ose/v1/share/taskDetail

{
  "taskId" : "string",
  "shareId" : "string",
  "kdstoken" : "string"
}

Example Responses

Status code: 200

OK

{
  "code" : "string",
  "msg" : "string",
  "taskInfo" : {
    "userId" : "string",
    "taskId" : "string",
    "taskType" : 0,
    "taskStatus" : 0,
    "taskResultCode" : 0,
    "resultCode" : 0,
    "createTime" : "string",
    "startTime" : "string",
    "endTime" : "string",
    "progress" : 0,
    "downloadUrl" : "string"
  }
}

Status Codes

Status Code

Description

200

OK