REST Resource: revisions
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
資源:修訂版本
檔案修訂版本的中繼資料。
部分資源方法 (例如 revisions.update
) 需要 revisionId
。使用 revisions.list
方法擷取修訂版本的 ID。
JSON 表示法 |
{
"exportLinks": {
string: string,
...
},
"id": string,
"mimeType": string,
"kind": string,
"published": boolean,
"keepForever": boolean,
"md5Checksum": string,
"modifiedTime": string,
"publishAuto": boolean,
"publishedOutsideDomain": boolean,
"publishedLink": string,
"size": string,
"originalFilename": string,
"lastModifyingUser": {
object (User )
}
} |
欄位 |
exportLinks |
map (key: string, value: string)
僅供輸出。將 Google 文件編輯器檔案匯出為特定格式的連結。 這個物件中包含 "key": value 組合的清單,範例:{ "name": "wrench", "mass": "1.3kg", "count": "3" } 。
|
id |
string
僅供輸出。修訂版本的 ID。
|
mimeType |
string
僅供輸出。修訂版本的 MIME 類型。
|
kind |
string
僅供輸出。表示資源的種類。值:固定字串 "drive#revision" 。
|
published |
boolean
這個修訂版本是否已發布。這項功能僅適用於 Google 文件編輯器檔案。
|
keepForever |
boolean
是否要永久保留這個修訂版本,即使該版本不再是最新修訂版本也一樣。如未設定,系統會在上傳新內容 30 天後自動清除修訂版本。最多可為 200 個檔案修訂版本設定這項功能。 這個欄位僅適用於雲端硬碟中有二進位內容的檔案。
|
md5Checksum |
string
僅供輸出。修訂內容的 MD5 檢查碼。這項功能僅適用於雲端硬碟中的二進位內容檔案。
|
modifiedTime |
string
僅供輸出。上次修改修訂版本的時間 (RFC 3339 日期時間)。
|
publishAuto |
boolean
後續修訂版本是否會自動重新發布。這項功能僅適用於 Google 文件編輯器檔案。
|
publishedOutsideDomain |
boolean
這個修訂版本是否發布至網域外部。這項功能僅適用於 Google 文件編輯器檔案。
|
publishedLink |
string
僅供輸出。已發布修訂版本的連結。這項資料只會填入 Google 文件編輯器檔案。
|
size |
string (int64 format)
僅供輸出。修訂版本內容的大小 (以位元組為單位)。這項功能僅適用於雲端硬碟中的二進位內容檔案。
|
originalFilename |
string
僅供輸出。用來建立這個修訂版本的原始檔案名稱。這項功能僅適用於雲端硬碟中的二進位內容檔案。
|
lastModifyingUser |
object (User )
僅供輸出。上次修改這個修訂版本的使用者。只有在上次修改是由已登入的使用者執行時,系統才會填寫這個欄位。
|
方法 |
|
永久刪除檔案版本。 |
|
依 ID 取得修訂版本的中繼資料或內容。 |
|
列出檔案的修訂版本。 |
|
以修補程式語意更新修訂版本。 |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-25 (世界標準時間)。
[null,null,["上次更新時間:2025-07-25 (世界標準時間)。"],[],[],null,["# REST Resource: revisions\n\n- [Resource: Revision](#Revision)\n - [JSON representation](#Revision.SCHEMA_REPRESENTATION)\n- [Methods](#METHODS_SUMMARY)\n\nResource: Revision\n------------------\n\nThe metadata for a revision to a file.\n\nSome resource methods (such as `revisions.update`) require a `revisionId`. Use the `revisions.list` method to retrieve the ID for a revision.\n\n| JSON representation |\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"exportLinks\": { string: string, ... }, \"id\": string, \"mimeType\": string, \"kind\": string, \"published\": boolean, \"keepForever\": boolean, \"md5Checksum\": string, \"modifiedTime\": string, \"publishAuto\": boolean, \"publishedOutsideDomain\": boolean, \"publishedLink\": string, \"size\": string, \"originalFilename\": string, \"lastModifyingUser\": { object (/workspace/drive/api/reference/rest/v3/User) } } ``` |\n\n| Fields ||\n|--------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `exportLinks` | `map (key: string, value: string)` Output only. Links for exporting Docs Editors files to specific formats. An object containing a list of `\"key\": value` pairs. Example: `{ \"name\": \"wrench\", \"mass\": \"1.3kg\", \"count\": \"3\" }`. |\n| `id` | `string` Output only. The ID of the revision. |\n| `mimeType` | `string` Output only. The MIME type of the revision. |\n| `kind` | `string` Output only. Identifies what kind of resource this is. Value: the fixed string `\"drive#revision\"`. |\n| `published` | `boolean` Whether this revision is published. This is only applicable to Docs Editors files. |\n| `keepForever` | `boolean` Whether to keep this revision forever, even if it is no longer the head revision. If not set, the revision will be automatically purged 30 days after newer content is uploaded. This can be set on a maximum of 200 revisions for a file. This field is only applicable to files with binary content in Drive. |\n| `md5Checksum` | `string` Output only. The MD5 checksum of the revision's content. This is only applicable to files with binary content in Drive. |\n| `modifiedTime` | `string` Output only. The last time the revision was modified (RFC 3339 date-time). |\n| `publishAuto` | `boolean` Whether subsequent revisions will be automatically republished. This is only applicable to Docs Editors files. |\n| `publishedOutsideDomain` | `boolean` Whether this revision is published outside the domain. This is only applicable to Docs Editors files. |\n| `publishedLink` | `string` Output only. A link to the published revision. This is only populated for Docs Editors files. |\n| `size` | `string (`[int64](https://developers.google.com/discovery/v1/type-format)` format)` Output only. The size of the revision's content in bytes. This is only applicable to files with binary content in Drive. |\n| `originalFilename` | `string` Output only. The original filename used to create this revision. This is only applicable to files with binary content in Drive. |\n| `lastModifyingUser` | `object (`[User](/workspace/drive/api/reference/rest/v3/User)`)` Output only. The last user to modify this revision. This field is only populated when the last modification was performed by a signed-in user. |\n\n| Methods ------- ||\n|-----------------------------------------------------------------------|----------------------------------------------|\n| ### [delete](/workspace/drive/api/reference/rest/v3/revisions/delete) | Permanently deletes a file version. |\n| ### [get](/workspace/drive/api/reference/rest/v3/revisions/get) | Gets a revision's metadata or content by ID. |\n| ### [list](/workspace/drive/api/reference/rest/v3/revisions/list) | Lists a file's revisions. |\n| ### [update](/workspace/drive/api/reference/rest/v3/revisions/update) | Updates a revision with patch semantics. |"]]