Copied.
Listing Shared Files
Function
List shared files. (This function is available only to whitelisted users.)
URI
POST /koodrive/ose/v1/share/public/files
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| 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: N/A Default Value: en-US |
| X-Hw-Agentname | Yes | String | Definition: Carrier name. Constraints: N/A Range: N/A Default Value: N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| shortUrl | Yes | String | Definition: Sharing short code. Constraints: N/A Range: N/A Default Value: N/A |
| parentFolder | No | String | Definition: File ID of the parent directory. Constraints: N/A Range: N/A Default Value: N/A |
| pageSize | No | Integer | Definition: Number of results returned on each page. It is possible that partial or empty result pages are returned before the end of the result list has been reached. Constraints: N/A Range: The minimum value is 1 and the maximum value is 100. Default Value: 100 |
| pageCursor | No | String | Definition: Current page cursor, which is obtained from nextCursor of the previous response. Constraints: N/A Range: N/A Default Value: N/A |
| sortType | No | Integer | Definition: Sorting type. Constraints: N/A Range: 1: by file name 2: by file size 4: by modification time Default Value: 4 |
| sortDirection | No | Integer | Definition: Sorting direction. 1: ascending 2: descending. Constraints: N/A Range: N/A Default Value: 2 |
| kdstoken | No | String | Definition: Temporary token for sharing. Constraints: N/A Range: N/A Default Value: N/A |
| refreshCount | No | Boolean | Definition: Whether this API call is counted as a file view. Constraints: N/A Range: N/A Default Value: N/A |
| fileName | No | String | Definition: File name. Constraints: N/A Range: N/A Default Value: N/A |
| imageProcess | No | String | Definition: Thumbnail size of an image, for example, image/resize,m_lfit,h_128,w_128. Constraints: A maximum of five groups can be transferred, for example, image/resize,m_lfit,h_1080,w_1080;image/resize,m_lfit,h_128,w_128. This example contains two groups. Range: N/A Default Value: image/resize,m_lfit,h_128,w_128 |
| usage | No | String | Definition: Document and video thumbnail formats. Constraints: The maximum length is 100. Range: minThumbnail, midThumbnail, largeThumbnail, and superLargeThumbnail Default Value: N/A |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Response code. |
| msg | String | Response information. |
| nextCursor | String | Pagination cursor. If the cursor does not exist, the last record has been returned. |
| link | CommonShareLink object | Public information of the access link. |
| files | Array of ShareFile objects | List of shared files. |
| Parameter | Type | Description |
|---|---|---|
| shareId | String | Sharing ID. |
| shortUrl | String | Sharing short code. |
| shareTime | String | Time when the file is shared. |
| ownerId | String | Sharer ID. |
| ownerName | String | Sharer name. |
| expireTime | String | Expiration time. |
| status | Integer | Sharing status. 0: determined based on the expiration time. 1: The file has been deleted. 2: invalid. 3: expired. |
| expireDate | String | Validity period. |
| Parameter | Type | Description |
|---|---|---|
| id | String | *File ID. |
| fileName | String | *File name, which contains up to 250 bytes. |
| fileType | String | File type, which is input externally. |
| parentFolder | Array of strings | List of parent directory IDs. Currently, only the first ID is used. |
| fileSuffix | String | File name extension, which is the last character string of fullFileExtension. |
| size | Integer | File size. |
| containers | Array of strings | Space ID. |
| downloadLinks | Map<String,downloadLinks> | Download link. |
| editedTime | String | File modification time. |
Example Requests
/koodrive/ose/v1/share/public/files
{
"shortUrl" : "1808628918203192832",
"parentFolder" : "",
"pageSize" : 100,
"pageCursor" : "",
"sortType" : "4",
"sortDirection" : "2",
"refreshCount" : false,
"kdstoken" : ""
} Example Responses
Status code: 200
OK
{
"link" : {
"shareId" : "15929**********1824",
"shortUrl" : "1592**********1825",
"shareTime" : "2025-01-06T11:42:37.037Z",
"ownerId" : "1592**********54689",
"ownerName" : "",
"expireTime" : "2025-01-18T11:58:00.000Z",
"expireDate" : "11",
"status" : 0
},
"files" : [ {
"id" : "FnpODb**********Jw-KX6fZi",
"fileName" : "fileName",
"fileSuffix" : "",
"size" : 106437,
"parentFolder" : [ "DFdpAjykCN**********I8pAjaA1592924124240415488" ],
"containers" : [ "IAAEDB**********24240415488" ],
"fileType" : "15",
"downloadLinks" : [ {
"usage" : "content",
"downloadLink" : "https://obs-koodrive.obs.cn-north-4.myhuaweicloud.com/********************?response-content-disposition********************e535458df2e3a90bfa788"
}, {
"usage" : "thumbnail",
"downloadLink" : "https://obs-koodrive.obs.cn-north-4.myhuaweicloud.com/********************?response-content-disposition********************e535458df2e3a90bfa788"
} ],
"editedTime" : "2025-01-06T11:41:58.806Z"
}, {
"id" : "Fh0x**********GJ5KWFrqSc5Cp",
"fileName" : "590x400.jfif",
"fileSuffix" : "jfif",
"size" : 106437,
"parentFolder" : [ "DFdp********************2924124240415488" ],
"containers" : [ "IAAEDB**********40415488" ],
"fileType" : "15",
"downloadLinks" : [ {
"usage" : "content",
"downloadLink" : "https://obs-koodrive.obs.cn-north-4.myhuaweicloud.com/********************?response-content-disposition********************e535458df2e3a90bfa788"
}, {
"usage" : "thumbnail",
"downloadLink" : "https://obs-koodrive.obs.cn-north-4.myhuaweicloud.com/********************?response-content-disposition********************e535458df2e3a90bfa788"
} ],
"editedTime" : "2025-01-06T11:41:10.790Z"
} ],
"code" : 0,
"msg" : "Success."
} Status Codes
| Status Code | Description |
|---|---|
| 200 | OK |
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