Obtaining the Version Information of a Specified File or Version ID
Function
Obtain the version information of a specified file or version ID.
Authorization Information
No identity policy-based permission required for calling this API.
URI
POST /koodrive/ose/v1/revision/getRevision
Request 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-User-Id |
Yes |
String |
User ID, which is used for app authentication. |
|
X-Date |
Yes |
String |
Date, which is used for app authentication. |
|
Host |
Yes |
String |
Address, which is used for app authentication. |
|
X-Traceid |
No |
String |
Message log trace ID. The value contains 58 bits. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
containerId |
Yes |
String |
Space ID. |
|
fileId |
Yes |
String |
File ID. |
|
revisionId |
Yes |
String |
assetId + versionId of the file. |
|
urlType |
No |
Integer |
Download URL type. By default, the external network access address is returned. For details, see the enumerated type UrlType (1: external network address; 2: internal network address). |
|
fields |
No |
String |
Currently, only * is supported. If this parameter is not transferred, * is used by default. |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
containerId |
String |
Space ID. |
|
fileId |
String |
File ID. |
|
revisionId |
String |
Version ID (assetId + "." + versionId returned by the cloud space). |
|
revisionVersion |
Long |
Version number, which is unique and increases in ascending order. |
|
keepForever |
Boolean |
Whether it is retained permanently. |
|
latestVersion |
Boolean |
Whether the version is the latest. Check whether the version ID is the same as that of files.get.metadata. |
|
createdAt |
Long |
Creation time (timestamp in milliseconds), which is the createdTime of the cloud space version query API. |
|
createdBy |
String |
createdBy of attributes returned by the query API. |
|
updatedAt |
Long |
Update time (timestamp in milliseconds), which is the editedTime of the cloud space version query API. |
|
updatedBy |
String |
Modifier ID. The third-party ID can be parsed from the userId of lastEditor in the query response. |
|
name |
String |
The file name (including the file name extension) cannot contain the following invalid characters: '', '/', ':', '*', '?', '"', '<', '>', and '|'. |
|
size |
Long |
File size in bytes. |
|
extension |
String |
File name extension, which is case insensitive. |
|
fileType |
Integer |
Check the fileType of the attributes of the API. |
|
description |
String |
Description, which is obtained by files.get.metadat. |
|
sha256 |
String |
Hash value of the file content, which is a hexadecimal string and is case insensitive. |
|
downloadUrl |
String |
Download URL of the file of a specified version. |
|
metadataAuditInfo |
FileAuditInfo object |
File metadata moderation information. |
|
contentAuditInfo |
FileAuditInfo object |
File content moderation information (returned only for common files). |
|
Parameter |
Type |
Description |
|---|---|---|
|
auditLevel |
Integer |
Moderation level. For details, see AuditLevel. |
|
auditResult |
Integer |
Moderation result. For details, see AuditResult. For file metadata moderation results, only 1 and 4 are supported. For file content moderation results, only 1, 2, and 3 are supported. |
|
auditDetail |
String |
Moderation result details. The value is a JSON string and can only be accessed. |
Example Requests
Obtain the version information of a specified file or version ID.
POST /koodrive/ose/v1/revision/getRevision
Authorization:Bearer+10f88d07fa************44791e9ff
{
"containerId": "IAAFotBZGfP8nAncA1605108881422443136",
"fileId": "Fk_LAN-LIgbxjFdH_YvJKoYW0vMjFyva8",
"revisionId": "1605664519244256128.1605664519244256129"
}
Example Responses
Status code: 200
Response to the request for obtaining the version information of a specified file or version ID.
{
"containerId" : "IAAFotBZGfP8nAncA1605108881422443136",
"fileId" : "Fk_LAN-LIgbxjFdH_YvJKoYW0vMjFyva8",
"revisionId" : "1605664519244256128.1605664519244256129",
"revisionVersion" : 512,
"keepForever" : false,
"latestVersion" : true,
"createdAt" : 1737682127312,
"createdBy" : "ee33a28d0f454801b4532233258822e4",
"updatedAt" : 1737682130017,
"updatedBy" : "ZWUzM2EyOGQwZjQ1NDgwMWI0NTMyMjMzMjU4ODIyZTQtZWUzM2EyOGQwZjQ1NDgwMWI0NTMyMjMzMjU4ODIyZTQ",
"name" : "ee33a28d0f454801b4532233258822e4",
"size" : 1872637,
"extension" : "AgAALVN-3Z5V2NASBMxH6L0DsLh7cKjg.jpeg",
"fileType" : 15,
"sha256" : "fb426b18ebc6ed393564f47371ab55e8f8e2b1336b195a877da1b7e7218a78fe",
"downloadUrl" : "https://b10-obs-ykj-uat-01.obs.cidc-rp-2006.joint.cmecloud.cn/5debce8cf8074c7",
"code" : 0,
"msg" : "success"
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
Response to the request for obtaining the version information of a specified file or version ID. |
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