您目前查看的是 Google Photos Library API 的舊版說明文件。
REST Resource: sharedAlbums
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
資源:相簿
表示 Google 相簿中的相簿。相簿是媒體項目的容器,如果應用程式已經分享相簿,其中會包含額外的 shareInfo
屬性。
JSON 表示法 |
{
"id": string,
"title": string,
"productUrl": string,
"isWriteable": boolean,
"shareInfo": {
object (ShareInfo )
},
"mediaItemsCount": string,
"coverPhotoBaseUrl": string,
"coverPhotoMediaItemId": string
} |
欄位 |
id |
string
專輯的 ID。這是一個永久 ID,可在工作階段之間用於識別此專輯。
|
title |
string
使用者在 Google 相簿帳戶中看到的相簿名稱。這個字串不得超過 500 個半形字元。
|
productUrl |
string
[僅供輸出] 相簿的 Google 相簿網址。使用者必須登入 Google 相簿帳戶,才能存取這個連結。
|
isWriteable |
boolean
[Output only] 如果您可以在這本相簿中建立媒體項目,則為 True。這個欄位會根據相簿的授權範圍和權限而定。如果範圍或相簿權限有所變更,這個欄位就會更新。
|
shareInfo |
object (ShareInfo )
[Output only] 共用相簿相關資訊。只有在相簿是共享相簿、開發人員建立相簿,且使用者已授予 photoslibrary.sharing 範圍時,這個欄位才會填入資料。
|
mediaItemsCount |
string (int64 format)
[Output only] 相簿中的媒體項目數量。
|
coverPhotoBaseUrl |
string
[僅供輸出] 封面相片位元組的網址。請勿依原樣使用。使用前請先在這個網址後方加上參數。如需完整的支援參數清單,請參閱開發人員說明文件。舉例來說,'=w2048-h1024' 會將封面相片的寬度和高度分別設為 2048 像素和 1024 像素。
|
coverPhotoMediaItemId |
string
與封面相片相關聯的媒體項目 ID。
|
方法 |
|
根據指定的 shareToken 傳回專輯。 |
|
代表 Google 相簿使用者加入共享相簿。 |
|
代表 Google 相簿使用者離開先前加入的共享相簿。 |
|
列出使用者 Google 相簿應用程式「共享」分頁中的所有共享相簿。 |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-25 (世界標準時間)。
[null,null,["上次更新時間:2025-07-25 (世界標準時間)。"],[[["\u003cp\u003eAlbums in Google Photos are containers for media items and can be shared.\u003c/p\u003e\n"],["\u003cp\u003eShared albums have a \u003ccode\u003eshareInfo\u003c/code\u003e property and developers can access them with the \u003ccode\u003ephotoslibrary.sharing\u003c/code\u003e scope.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eAlbum\u003c/code\u003e resource provides methods to get, join, leave, and list shared albums.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eAlbum\u003c/code\u003e properties provide information such as ID, title, URL, writability status, media count, and cover photo details.\u003c/p\u003e\n"]]],["Albums in Google Photos are containers for media items, identified by a unique `id` and a user-facing `title`. Key details include the album's `productUrl`, whether it's `isWriteable`, `mediaItemsCount`, and cover photo information (`coverPhotoBaseUrl`, `coverPhotoMediaItemId`). Shared albums contain a `shareInfo` property. Actions include: retrieving albums with a `shareToken`, joining, leaving, and listing shared albums via methods such as `get`, `join`, `leave`, and `list`.\n"],null,["# REST Resource: sharedAlbums\n\n- [Resource: Album](#Album)\n - [JSON representation](#Album.SCHEMA_REPRESENTATION)\n- [Methods](#METHODS_SUMMARY)\n\nResource: Album\n---------------\n\nRepresentation of an album in Google Photos. Albums are containers for media items. If an album has been shared by the application, it contains an extra `shareInfo` property.\n\n| JSON representation |\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"id\": string, \"title\": string, \"productUrl\": string, \"isWriteable\": boolean, \"shareInfo\": { object (/photos/library/legacy/reference/rest/v1/albums#Album.ShareInfo) }, \"mediaItemsCount\": string, \"coverPhotoBaseUrl\": string, \"coverPhotoMediaItemId\": string } ``` |\n\n| Fields ||\n|-------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `id` | `string` Identifier for the album. This is a persistent identifier that can be used between sessions to identify this album. |\n| `title` | `string` Name of the album displayed to the user in their Google Photos account. This string shouldn't be more than 500 characters. |\n| `productUrl` | `string` \\[Output only\\] Google Photos URL for the album. The user needs to be signed in to their Google Photos account to access this link. |\n| `isWriteable` | `boolean` \\[Output only\\] True if you can create media items in this album. This field is based on the scopes granted and permissions of the album. If the scopes are changed or permissions of the album are changed, this field is updated. |\n| `shareInfo` | `object (`[ShareInfo](/photos/library/legacy/reference/rest/v1/albums#Album.ShareInfo)`)` \\[Output only\\] Information related to shared albums. This field is only populated if the album is a shared album, the developer created the album and the user has granted the `photoslibrary.sharing` scope. |\n| `mediaItemsCount` | `string (`[int64](https://developers.google.com/discovery/v1/type-format)` format)` \\[Output only\\] The number of media items in the album. |\n| `coverPhotoBaseUrl` | `string` \\[Output only\\] A URL to the cover photo's bytes. This shouldn't be used as is. Parameters should be appended to this URL before use. See the [developer documentation](https://developers.google.com/photos/library/guides/access-media-items#base-urls) for a complete list of supported parameters. For example, `'=w2048-h1024'` sets the dimensions of the cover photo to have a width of 2048 px and height of 1024 px. |\n| `coverPhotoMediaItemId` | `string` Identifier for the media item associated with the cover photo. |\n\n| Methods ------- ||\n|--------------------------------------------------------------------------|---------------------------------------------------------------------------------------|\n| ### [get](/photos/library/legacy/reference/rest/v1/sharedAlbums/get) | Returns the album based on the specified `shareToken`. |\n| ### [join](/photos/library/legacy/reference/rest/v1/sharedAlbums/join) | Joins a shared album on behalf of the Google Photos user. |\n| ### [leave](/photos/library/legacy/reference/rest/v1/sharedAlbums/leave) | Leaves a previously-joined shared album on behalf of the Google Photos user. |\n| ### [list](/photos/library/legacy/reference/rest/v1/sharedAlbums/list) | Lists all shared albums available in the Sharing tab of the user's Google Photos app. |"]]