您目前查看的是 Google Photos Library API 的舊版說明文件。
REST Resource: albums
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
資源:相簿
表示 Google 相簿中的相簿。相簿是媒體項目的容器,如果應用程式已經分享相簿,其中會包含額外的 shareInfo
屬性。
JSON 表示法 |
{
"id": string,
"title": string,
"productUrl": string,
"isWriteable": boolean,
"shareInfo": {
object (ShareInfo )
},
"mediaItemsCount": string,
"coverPhotoBaseUrl": string,
"coverPhotoMediaItemId": string
} |
欄位 |
id |
string
專輯的 ID。這是一個永久性識別碼,可用於在各工作階段之間用來辨識這本相簿。
|
title |
string
在 Google 相簿帳戶中向使用者顯示的相簿名稱。這個字串不得超過 500 個半形字元。
|
productUrl |
string
[Output only] 相簿的 Google 相簿網址。使用者必須登入自己的 Google 相簿帳戶,才能存取這個連結。
|
isWriteable |
boolean
[Output only] 如果您可以在這本相簿中建立媒體項目,則為 True。這個欄位會根據相簿的授權範圍和權限而定。如果範圍有所變更,或相簿權限有所變更,這個欄位也會隨之更新。
|
shareInfo |
object (ShareInfo )
[僅供輸出] 與共用相簿相關的資訊。只有在相簿是共享相簿、開發人員建立相簿,且使用者將 photoslibrary.sharing 範圍設為共用相簿時,這個欄位才會填入資料。
|
mediaItemsCount |
string (int64 format)
[Output only] 相簿中的媒體項目數量。
|
coverPhotoBaseUrl |
string
[Output only] 封面相片的位元組網址。請勿依原樣使用。使用前請先在這個網址後方加上參數。如需完整的支援參數清單,請參閱開發人員說明文件。舉例來說,'=w2048-h1024' 可將封面相片的尺寸設為 2048 像素,高度則為 1024 像素。
|
coverPhotoMediaItemId |
string
與封面相片相關的媒體項目 ID。
|
ShareInfo
共享相簿的資訊。只有在您建立相簿、與他人共享相簿,以及設定共用範圍的情況下,系統才會納入這類資訊。
JSON 表示法 |
{
"sharedAlbumOptions": {
object (SharedAlbumOptions )
},
"shareableUrl": string,
"shareToken": string,
"isJoined": boolean,
"isOwned": boolean,
"isJoinable": boolean
} |
欄位 |
sharedAlbumOptions |
object (SharedAlbumOptions )
控管其他人能否在共享相簿中新增媒體項目或留言。
|
shareableUrl |
string
共享 Google 相簿的相簿連結。凡是知道連結的人都能查看相簿內容,因此請謹慎處理。 只有在相簿已啟用連結共享功能時,才會傳回 shareableUrl 參數。如果使用者已加入非透過連結共享的相簿,可以改用相簿的 productUrl 存取相簿。 如果擁有者關閉 Google 相簿應用程式中的連結共用設定,或是相簿已取消共享,shareableUrl 就會失效。
|
shareToken |
string
此權杖可用於代表非擁有者加入、離開或擷取共享相簿的詳細資料。 如果擁有者關閉 Google 相簿應用程式中的連結共用設定,或是相簿已取消共享,shareToken 就會失效。
|
isJoined |
boolean
如果使用者加入相簿,則為「是」。對相簿擁有者而言,這點一律是。
|
isOwned |
boolean
如果使用者是相簿的擁有者,則為「是」。
|
isJoinable |
boolean
如果使用者可以加入相簿,則為「是」。
|
SharedAlbumOptions
JSON 表示法 |
{
"isCollaborative": boolean,
"isCommentable": boolean
} |
欄位 |
isCollaborative |
boolean
如果共享相簿允許協作者 (已加入相簿的使用者) 在相簿中新增媒體項目,則為「是」。預設值為 false。
|
方法 |
|
在已定義相簿的特定位置新增充實內容。 |
|
將使用者的 Google 相簿相片庫中的一或多個媒體項目新增至相簿。 |
|
從指定相簿中移除一或多個媒體項目。 |
|
在使用者的 Google 相簿相片庫中建立相簿。 |
|
根據指定的 albumId 傳回專輯。 |
|
在 Google 相簿應用程式的「相簿」分頁中,列出使用者看到的所有相簿。 |
|
使用指定的 id 更新相簿。 |
|
將相簿標示為共享,其他使用者可存取。 |
|
將先前共享的相簿標示為私人。 |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-09-12 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2024-09-12 (世界標準時間)。"],[[["The Album resource represents albums in Google Photos, acting as containers for media items and including share information for shared albums."],["Albums have properties like ID, title, product URL, writeability, share details, media item count, and cover photo information."],["Shared albums have options to control collaboration (adding media) and commenting, along with shareable URLs and tokens for access."],["Developers can use various methods to manage albums, including creating, getting, listing, updating, adding/removing media, sharing, and unsharing."],["ShareInfo and SharedAlbumOptions objects provide further details about shared album configurations and access control."]]],["This document outlines the structure and functionality of Google Photos albums. An album resource contains metadata like `id`, `title`, `productUrl`, and whether it's writeable. Shared albums have a `shareInfo` object with details like `shareableUrl`, `shareToken`, and join status. Shared album options manage collaboration (`isCollaborative`) and commenting (`isCommentable`). Various methods exist for album management, including creating, retrieving, updating, sharing, adding/removing media items, and enriching albums.\n"]]