Method: presentations.pages.getThumbnail
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
產生簡報中指定網頁最新版本的縮圖,並傳回縮圖圖片的網址。
在計算配額用量時,這項要求會計為耗用大量資源的讀取要求。
HTTP 要求
GET https://slides.googleapis.com/v1/presentations/{presentationId}/pages/{pageObjectId}/thumbnail
這個網址使用 gRPC 轉碼語法。
路徑參數
參數 |
presentationId |
string
要擷取的簡報 ID。
|
pageObjectId |
string
要擷取縮圖的網頁物件 ID。
|
查詢參數
參數 |
thumbnailProperties |
object (ThumbnailProperties )
縮圖屬性。
|
回應主體
網頁的縮圖。
如果成功,回應主體會含有以下結構的資料:
JSON 表示法 |
{
"width": integer,
"height": integer,
"contentUrl": string
} |
欄位 |
width |
integer
縮圖圖片的正向寬度 (以像素為單位)。
|
height |
integer
縮圖圖片的正高度 (以像素為單位)。
|
contentUrl |
string
縮圖圖片的內容網址。 圖片的網址預設存留時間為 30 分鐘。這個網址會標記要求者的帳戶。凡是取得網址的使用者,都能以原始要求者的身分存取圖片。如果簡報的共用設定有所變更,您可能就無法存取圖片。縮圖圖片的 mime 類型與 GetPageThumbnailRequest 中指定的類型相同。
|
授權範圍
需要下列其中一種 OAuth 範圍:
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.file
https://www.googleapis.com/auth/drive.readonly
https://www.googleapis.com/auth/presentations
https://www.googleapis.com/auth/presentations.readonly
詳情請參閱授權指南。
ThumbnailProperties
欄位 |
mimeType |
enum (MimeType )
縮圖圖片的選用 MIME 類型。 如果未指定 MIME 類型,系統會預設為 PNG。
|
thumbnailSize |
enum (ThumbnailSize )
選用的縮圖圖片大小。 如果未指定大小,伺服器會選擇圖片的預設大小。
|
ThumbnailSize
列舉 |
THUMBNAIL_SIZE_UNSPECIFIED |
預設縮圖圖片大小。 未指定縮圖大小,表示伺服器選擇圖片大小的方式日後可能會有所不同。 |
LARGE |
縮圖圖片寬度為 1600 像素。 |
MEDIUM |
縮圖圖片的寬度為 800 像素。 |
SMALL |
縮圖圖片的寬度為 200 像素。 |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-03-25 (世界標準時間)。
[null,null,["上次更新時間:2025-03-25 (世界標準時間)。"],[],[],null,["# Method: presentations.pages.getThumbnail\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n - [JSON representation](#body.Thumbnail.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [ThumbnailProperties](#ThumbnailProperties)\n - [JSON representation](#ThumbnailProperties.SCHEMA_REPRESENTATION)\n- [MimeType](#MimeType)\n- [ThumbnailSize](#ThumbnailSize)\n- [Try it!](#try-it)\n\nGenerates a thumbnail of the latest version of the specified page in the presentation and returns a URL to the thumbnail image.\n\nThis request counts as an [expensive read request](https://developers.google.com/workspace/slides/limits) for quota purposes.\n\n### HTTP request\n\n`GET https://slides.googleapis.com/v1/presentations/{presentationId}/pages/{pageObjectId}/thumbnail`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|------------------|-----------------------------------------------------------------|\n| `presentationId` | `string` The ID of the presentation to retrieve. |\n| `pageObjectId` | `string` The object ID of the page whose thumbnail to retrieve. |\n\n### Query parameters\n\n| Parameters ||\n|-----------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `thumbnailProperties` | `object (`[ThumbnailProperties](/workspace/slides/api/reference/rest/v1/presentations.pages/getThumbnail#ThumbnailProperties)`)` The thumbnail properties. |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nThe thumbnail of a page.\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|-----------------------------------------------------------------------|\n| ``` { \"width\": integer, \"height\": integer, \"contentUrl\": string } ``` |\n\n| Fields ||\n|--------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `width` | `integer` The positive width in pixels of the thumbnail image. |\n| `height` | `integer` The positive height in pixels of the thumbnail image. |\n| `contentUrl` | `string` The content URL of the thumbnail image. The URL to the image has a default lifetime of 30 minutes. This URL is tagged with the account of the requester. Anyone with the URL effectively accesses the image as the original requester. Access to the image may be lost if the presentation's sharing settings change. The mime type of the thumbnail image is the same as specified in the `GetPageThumbnailRequest`. |\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/drive`\n- `https://www.googleapis.com/auth/drive.file`\n- `https://www.googleapis.com/auth/drive.readonly`\n- `https://www.googleapis.com/auth/presentations`\n- `https://www.googleapis.com/auth/presentations.readonly`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent).\n\nThumbnailProperties\n-------------------\n\nProvides control over page thumbnail creation.\n\n| JSON representation |\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"mimeType\": enum (/workspace/slides/api/reference/rest/v1/presentations.pages/getThumbnail#MimeType), \"thumbnailSize\": enum (/workspace/slides/api/reference/rest/v1/presentations.pages/getThumbnail#ThumbnailSize) } ``` |\n\n| Fields ||\n|-----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `mimeType` | `enum (`[MimeType](/workspace/slides/api/reference/rest/v1/presentations.pages/getThumbnail#MimeType)`)` The optional mime type of the thumbnail image. If you don't specify the mime type, the mime type defaults to PNG. |\n| `thumbnailSize` | `enum (`[ThumbnailSize](/workspace/slides/api/reference/rest/v1/presentations.pages/getThumbnail#ThumbnailSize)`)` The optional thumbnail image size. If you don't specify the size, the server chooses a default size of the image. |\n\nMimeType\n--------\n\nThe mime type of the thumbnail image.\n\n| Enums ||\n|-------|------------------------|\n| `PNG` | The default mime type. |\n\nThumbnailSize\n-------------\n\nThe predefined thumbnail image sizes.\n\n| Enums ||\n|------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `THUMBNAIL_SIZE_UNSPECIFIED` | The default thumbnail image size. The unspecified thumbnail size implies that the server chooses the size of the image in a way that might vary in the future. |\n| `LARGE` | The thumbnail image width of 1600px. |\n| `MEDIUM` | The thumbnail image width of 800px. |\n| `SMALL` | The thumbnail image width of 200px. |"]]