Creating a Batch Task
Function
Create a batch task.
URI
POST /koodrive/ose/v1/jobs
Request Parameters
Parameter | Mandatory | Type | Description |
|---|---|---|---|
Authorization | Yes | String | Definition: 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}. Constraints: N/A Range: N/A Default Value: N/A |
X-Traceid | No | String | Definition: Service trace ID, which contains 58 bits. Constraints: N/A Range: The value contains 58 bits. Default Value: N/A |
language | No | String | Definition: Language code. Constraints: The value must comply with the internationalization specifications. For example, en_us indicates English (United States). Range: The value must comply with the internationalization specifications. Default Value: en-US |
X-User-Id | Yes | String | Definition: User ID on KooDrive, which is used for app authentication. Constraints: N/A Range: N/A Default Value: N/A |
X-Date | Yes | String | Definition: Date, which is used for app authentication. Constraints: The format is yyyyMMDD'T'HHmmss'Z', for example, 20251103T070140Z. Range: The value must be within 15 minutes from the current time and cannot be later than the current time. Default Value: N/A |
x-hw-share-folder-id | No | String | Definition: ID of the shared folder. If this request header is passed, the current operation is performed in the shared folder. Constraints: N/A Range: N/A Default Value: N/A |
Parameter | Mandatory | Type | Description |
|---|---|---|---|
taskType | Yes | Integer | Definition: Task type. Constraints: Enumerated values:
Range: 1–7 Default Value: N/A |
actionType | No | Integer | Definition: Operation type, which is a subdivision of taskType. Constraints: Enumerated values: This parameter is used only when taskType is set to 1, 2, or 3. Range: N/A Default Value: N/A |
taskInfo | Yes | CreateTaskInfoReq object | Task information. |
dstContainerId | Yes | String | Definition: Target space ID of a batch job. Constraints: N/A Range: N/A Default Value: N/A |
password | No | String | Definition: Compressed package password. This parameter is involved only when taskType is set to 5 (cloud decompression). Constraints: N/A Range: N/A Default Value: N/A |
Parameter | Mandatory | Type | Description |
|---|---|---|---|
fileInfo | Yes | Array of fileInfo objects | File/Directory ID (optional when taskType is set to 7). |
newFilePath | No | String | New path of the file (optional when taskType is set to 7). |
srcContainerId | Yes | String | Source space ID. |
uncompressFilePaths | No | Array of strings | List of full paths of partially decompressed files in the compressed package. |
Parameter | Mandatory | Type | Description |
|---|---|---|---|
fileId | No | String | File ID (optional for recycle bin clearance). |
filePath | No | String | Full path of the file, including the file ID. (This parameter is mandatory for logical deletion, that is, moving the file to the recycle bin, which affects the restoration function.) |
Response Parameters
Status code: 200
Parameter | Type | Description |
|---|---|---|
code | String | Error code. |
msg | String | Error message. |
data | String | Task ID. |
Status code: 400
Parameter | Type | Description |
|---|---|---|
code | String | Response code. |
msg | String | Response description. |
Status code: 401
Parameter | Type | Description |
|---|---|---|
code | String | Response code. |
msg | String | Response description. |
Status code: 500
Parameter | Type | Description |
|---|---|---|
code | String | Response code. |
msg | String | Response description. |
Example Requests
Request for copying files.
POST /koodrive/ose/v1/jobs
Authorization:Bearer+10f88d07fa************44791e9ff
{
"taskType":1 ,
"actionType":101 ,
"dstContainerId": "IAADfsBFCO6WtAtuA315074383680425b8aa9a130cba2d4" ,
"taskInfo": {
"srcContainerId": "IAADfsBFCO6WtAtuA315074383680425b8aa9a130cba2d4",
"newFilePath": "Fm9UdqBNTAQDos6l1xPlFnIqXJg2-UdqA" ,
"fileInfo": [
{
"fileId": "FuZmQ66CF0DdpKRG1Y29Iwajbq04Nhwu3"
}
]
}
} Example Responses
Status code: 200
Basic response. Only the error code and error information are returned.
{
"data": "1309243162258308352"
"code": 0,
"msg": "success"
} Status Codes
Status Code | Description |
|---|---|
200 | Basic response. Only the error code and error information are returned. |
400 | Bad Request |
401 | Unauthorized |
500 | Internal Server Error |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot
