Updated on 2026-02-12 GMT+08:00

Obtaining Upload Links

Function

Generate the upload link of a file part for multipart upload.

URI

POST /koodrive/ose/v1/files/multipart/uploadUrl

Request Parameters

Table 1 Request header parameters

Parameter

Mandatory

Type

Description

language

No

String

Definition:

Language code.

Constraints:

The value must comply with the internationalization specifications. For example, en_us indicates English (United States).

Range:

N/A

Default Value:

If this parameter is not transferred, English (United States) is used by default.

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.

Constraints:

The format is Bearer+{access_token}.

Range:

For details about how to obtain an access token, see the corresponding developer guide.

Default Value:

N/A

X-Traceid

No

String

Definition:

Message log trace ID. The value contains 58 bits.

Constraints:

N/A

Range:

N/A

Default Value:

N/A

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 value must be within 15 minutes from the current time and cannot be later than the current time.

Range:

The format is yyyMMdd'T'HHmmss'Z', for example, 20251103T070140Z.

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

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

fileId

Yes

String

Definition:

File ID.

Constraints:

N/A

Range:

N/A

Default Value:

N/A

multiParts

Yes

Array of MultiPartInfo objects

Definition:

Part information list.

Constraints:

N/A

Range:

N/A

Default Value:

N/A

Table 3 MultiPartInfo

Parameter

Mandatory

Type

Description

partNumber

Yes

Integer

Definition:

Part No.

Constraints:

The part number ranges from 1 to 10000.

Range:

N/A

Default Value:

N/A

partSize

Yes

Long

Definition:

Part length.

Constraints:

N/A

Range:

minimum: 0 -maximum: 5368709120. The value range is [5,242,880, 5,368,709,120]. The value range of the last part is [0, 5,368,709,120].

Default Value:

N/A

partOffset

No

Long

Definition:

Total length to the last data block.

Constraints:

The unit is byte. This parameter is valid only during concurrent multipart upload. The size of all parts except the last one must be a multiple of 64 bytes.

Range:

N/A

Default Value:

N/A

hashCtx

No

Array of longs

Definition:

Context used to iteratively calculate SHA256.

Constraints:

This field is valid only during concurrent multipart upload. For SHA256, the value is the first to eighth 32-bit variables of the SHA256 of the previous data block.

This parameter is mandatory for all parts except the first one in concurrent multipart upload.

Range:

N/A

Default Value:

N/A

uploadUrl

No

String

Definition:

URL for uploading a file.

Constraints:

The PUT method is required for uploading files.

Range:

N/A

Default Value:

N/A

partId

No

String

Definition:

Part object ID.

Constraints:

N/A

Range:

N/A

Default Value:

N/A

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

multiParts

Array of MultiPartInfo objects

Multipart information.

code

Integer

Response code.

msg

String

Response message.

Table 5 MultiPartInfo

Parameter

Type

Description

partNumber

Integer

Definition:

Part No.

Constraints:

The part number ranges from 1 to 10000.

Range:

N/A

Default Value:

N/A

partSize

Long

Definition:

Part length.

Constraints:

N/A

Range:

minimum: 0 -maximum: 5368709120. The value range is [5,242,880, 5,368,709,120]. The value range of the last part is [0, 5,368,709,120].

Default Value:

N/A

partOffset

Long

Definition:

Total length to the last data block.

Constraints:

The unit is byte. This parameter is valid only during concurrent multipart upload. The size of all parts except the last one must be a multiple of 64 bytes.

Range:

N/A

Default Value:

N/A

hashCtx

Array of longs

Definition:

Context used to iteratively calculate SHA256.

Constraints:

This field is valid only during concurrent multipart upload. For SHA256, the value is the first to eighth 32-bit variables of the SHA256 of the previous data block.

This parameter is mandatory for all parts except the first one in concurrent multipart upload.

Range:

N/A

Default Value:

N/A

uploadUrl

String

Definition:

URL for uploading a file.

Constraints:

The PUT method is required for uploading files.

Range:

N/A

Default Value:

N/A

partId

String

Definition:

Part object ID.

Constraints:

N/A

Range:

N/A

Default Value:

N/A

Example Requests

Creates file metadata in multipart upload mode. In this example, a file is divided into 46 to 50 parts. The upload link of the part is returned in the subsequent response. The part needs to be uploaded through a PUT request.

POST /koodrive/ose/v1/files/multipart/uploadUrl

Authorization:Bearer+10f88*********4791e9ff
{
	"fileId": "Fqo2kYHmsgWg5whxzYHZLL7mebXbBr1no",
	"multiParts": [
		{
			"hashCtx": [
				1748048713,
				2644528514,
				4267727253,
				2252747490,
				4036182088,
				2253856463,
				526139147,
				2194267752
			],
			"partNumber": 46,
			"partOffset": 471859200,
			"partSize": 10485760
		},
		{
			"hashCtx": [
				1606212,
				1743131457,
				2392241618,
				605997363,
				3054356113,
				673008609,
				3509469858,
				2186398707
			],
			"partNumber": 47,
			"partOffset": 482344960,
			"partSize": 10485760
		},
		{
			"hashCtx": [
				3734586607,
				1407828785,
				3243195625,
				3451635323,
				4031416500,
				3005674269,
				2829389145,
				3478923465
			],
			"partNumber": 48,
			"partOffset": 492830720,
			"partSize": 10485760
		},
		{
			"hashCtx": [
				3677016828,
				906610338,
				3389225168,
				2507561547,
				1134075905,
				3951513567,
				1673174790,
				3034719756
			],
			"partNumber": 49,
			"partOffset": 503316480,
			"partSize": 10485760
		},
		{
			"hashCtx": [
				1827691250,
				2956926651,
				1801460777,
				4119662276,
				4162375117,
				187866976,
				1789369655,
				278284511
			],
			"partNumber": 50,
			"partOffset": 513802240,
			"partSize": 10485760
		}
	]
}

Example Responses

Status code: 200

Upload information of the corresponding part.

{
  "multiParts" : [ {
    "partNumber" : 46,
    "partSize" : 10485760,
    "partOffset" : 471859200,
    "hashCtx" : [ 1748048713, 2644528514, 4267727253, 2252747490, 4036182088, 2253856463, 526139147, 2194267752 ],
    "uploadUrl" : "https://b10-obs-ykj-uat-01.obs.cidc-rp-2006.joint.cmecloud.cn/4e8108ee15fa471cbe5f18f03e8b555b086?partNumber=46&uploadId=0000019039E1E8520006EBE63B492EDB&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20240621T082041Z&X-Amz-SignedHeaders=content-length%3Bhost&X-Amz-Expires=3600&X-Amz-Credential=MKRISPBZAJWFHNBJ5WLB%2F20240621%2Fcidc-rp-2006%2Fs3%2Faws4_request&X-Amz-Iteration-Hash-Ctx=eyJtZF9sZW4iOjMyLCJudW0iOjAsImgiOlsxNzQ4MDQ4NzEzLDI2NDQ1Mjg1MTQsNDI2NzcyNzI1MywyMjUyNzQ3NDkwLDQwMzYxODIwODgsMjI1Mzg1NjQ2Myw1MjYxMzkxNDcsMjE5NDI2Nzc1Ml0sIm5oIjowLCJubCI6Mzc3NDg3MzYwMCwiaGFzaF90eXBlIjoic2hhMjU2In0%3D&X-Amz-Signature=d3e7f60f45c8fd3960e697c57bb7d1c386dd20940b860fd976ba77425767d65e"
  }, {
    "partNumber" : 47,
    "partSize" : 10485760,
    "partOffset" : 482344960,
    "hashCtx" : [ 1606212, 1743131457, 2392241618, 605997363, 3054356113, 673008609, 3509469858, 2186398707 ],
    "uploadUrl" : "https://b10-obs-ykj-uat-01.obs.cidc-rp-2006.joint.cmecloud.cn/4e8108ee15fa471cbe5f18f03e8b555b086?partNumber=47&uploadId=0000019039E1E8520006EBE63B492EDB&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20240621T082041Z&X-Amz-SignedHeaders=content-length%3Bhost&X-Amz-Expires=3600&X-Amz-Credential=MKRISPBZAJWFHNBJ5WLB%2F20240621%2Fcidc-rp-2006%2Fs3%2Faws4_request&X-Amz-Iteration-Hash-Ctx=eyJtZF9sZW4iOjMyLCJudW0iOjAsImgiOlsxNjA2MjEyLDE3NDMxMzE0NTcsMjM5MjI0MTYxOCw2MDU5OTczNjMsMzA1NDM1NjExMyw2NzMwMDg2MDksMzUwOTQ2OTg1OCwyMTg2Mzk4NzA3XSwibmgiOjAsIm5sIjozODU4NzU5NjgwLCJoYXNoX3R5cGUiOiJzaGEyNTYifQ%3D%3D&X-Amz-Signature=38980d3be00e528ee11c366ae69e950d673528203f3869a26f39dae42b4dabbb"
  }, {
    "partNumber" : 48,
    "partSize" : 10485760,
    "partOffset" : 492830720,
    "hashCtx" : [ 3734586607, 1407828785, 3243195625, 3451635323, 4031416500, 3005674269, 2829389145, 3478923465 ],
    "uploadUrl" : "https://b10-obs-ykj-uat-01.obs.cidc-rp-2006.joint.cmecloud.cn/4e8108ee15fa471cbe5f18f03e8b555b086?partNumber=48&uploadId=0000019039E1E8520006EBE63B492EDB&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20240621T082041Z&X-Amz-SignedHeaders=content-length%3Bhost&X-Amz-Expires=3600&X-Amz-Credential=MKRISPBZAJWFHNBJ5WLB%2F20240621%2Fcidc-rp-2006%2Fs3%2Faws4_request&X-Amz-Iteration-Hash-Ctx=eyJtZF9sZW4iOjMyLCJudW0iOjAsImgiOlszNzM0NTg2NjA3LDE0MDc4Mjg3ODUsMzI0MzE5NTYyNSwzNDUxNjM1MzIzLDQwMzE0MTY1MDAsMzAwNTY3NDI2OSwyODI5Mzg5MTQ1LDM0Nzg5MjM0NjVdLCJuaCI6MCwibmwiOjM5NDI2NDU3NjAsImhhc2hfdHlwZSI6InNoYTI1NiJ9&X-Amz-Signature=d5608f38d6afdfee117be1243870b63f46ff11676633e0630d122f0c4145e8ae"
  }, {
    "partNumber" : 49,
    "partSize" : 10485760,
    "partOffset" : 503316480,
    "hashCtx" : [ 3677016828, 906610338, 3389225168, 2507561547, 1134075905, 3951513567, 1673174790, 3034719756 ],
    "uploadUrl" : "https://b10-obs-ykj-uat-01.obs.cidc-rp-2006.joint.cmecloud.cn/4e8108ee15fa471cbe5f18f03e8b555b086?partNumber=49&uploadId=0000019039E1E8520006EBE63B492EDB&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20240621T082041Z&X-Amz-SignedHeaders=content-length%3Bhost&X-Amz-Expires=3600&X-Amz-Credential=MKRISPBZAJWFHNBJ5WLB%2F20240621%2Fcidc-rp-2006%2Fs3%2Faws4_request&X-Amz-Iteration-Hash-Ctx=eyJtZF9sZW4iOjMyLCJudW0iOjAsImgiOlszNjc3MDE2ODI4LDkwNjYxMDMzOCwzMzg5MjI1MTY4LDI1MDc1NjE1NDcsMTEzNDA3NTkwNSwzOTUxNTEzNTY3LDE2NzMxNzQ3OTAsMzAzNDcxOTc1Nl0sIm5oIjowLCJubCI6NDAyNjUzMTg0MCwiaGFzaF90eXBlIjoic2hhMjU2In0%3D&X-Amz-Signature=52eb71278fc9310f13a5b92641b5a726d0006be8dd89a242f9c4ce09c360e1f7"
  }, {
    "partNumber" : 50,
    "partSize" : 10485760,
    "partOffset" : 513802240,
    "hashCtx" : [ 1827691250, 2956926651, 1801460777, 4119662276, 4162375117, 187866976, 1789369655, 278284511 ],
    "uploadUrl" : "https://b10-obs-ykj-uat-01.obs.cidc-rp-2006.joint.cmecloud.cn/4e8108ee15fa471cbe5f18f03e8b555b086?partNumber=50&uploadId=0000019039E1E8520006EBE63B492EDB&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20240621T082041Z&X-Amz-SignedHeaders=content-length%3Bhost&X-Amz-Expires=3600&X-Amz-Credential=MKRISPBZAJWFHNBJ5WLB%2F20240621%2Fcidc-rp-2006%2Fs3%2Faws4_request&X-Amz-Iteration-Hash-Ctx=eyJtZF9sZW4iOjMyLCJudW0iOjAsImgiOlsxODI3NjkxMjUwLDI5NTY5MjY2NTEsMTgwMTQ2MDc3Nyw0MTE5NjYyMjc2LDQxNjIzNzUxMTcsMTg3ODY2OTc2LDE3ODkzNjk2NTUsMjc4Mjg0NTExXSwibmgiOjAsIm5sIjo0MTEwNDE3OTIwLCJoYXNoX3R5cGUiOiJzaGEyNTYifQ%3D%3D&X-Amz-Signature=154bcd4ad7774f20e196666d403bf3d4359dd151b9cb1cc1f604c6517c4a287b"
  } ],
  "code" : 0,
  "msg" : "Success."
}

Status Codes

Status Code

Description

200

Upload information of the corresponding part.