2025 年 4 月 1 日,我们移除了 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
影集的标识符。这是一个永久标识符,可用于在会话之间标识此影集。
|
title |
string
在用户的 Google 相册账号中显示的影集的名称。此字符串不应超过 500 个字符。
|
productUrl |
string
[仅适用于输出] 影集的 Google 相册网址。只有在登录 Google 相册账号后,用户才能访问此链接。
|
isWriteable |
boolean
[仅适用于输出] 如果您可以在此影集中创建媒体内容,则该值为 True。此字段基于授权的范围和影集的权限。更改范围或影集权限后,此字段便会更新。
|
shareInfo |
object (ShareInfo )
[仅适用于输出] 共享影集的相关信息。仅当该影集为共享影集、其创建者为开发者,且用户已向 photoslibrary.sharing 范围授权时,系统才会填充此字段。
|
mediaItemsCount |
string (int64 format)
[仅适用于输出] 影集中的媒体内容数量。
|
coverPhotoBaseUrl |
string
[仅适用于输出] 指向封面照片字节的网址。您不能直接使用该网址,而应在使用前向其附加参数。如需查看支持的参数的完整列表,请参阅开发者文档。例如,'=w2048-h1024' 会将封面照片的尺寸设置为 2048 像素(宽)× 1024 像素(高)。
|
coverPhotoMediaItemId |
string
与封面照片相关联的媒体内容的标识符。
|
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
如果用户已加入影集,则为 True。对于影集的所有者而言,该值始终为 True。
|
isOwned |
boolean
如果用户为影集的所有者,则该值为 True。
|
isJoinable |
boolean
如果用户可以加入影集,则为 True。
|
SharedAlbumOptions
JSON 表示法 |
{
"isCollaborative": boolean,
"isCommentable": boolean
} |
字段 |
isCollaborative |
boolean
如果共享影集允许协作者(已加入影集的用户)向其添加媒体内容,则该值为 True。默认值为 false。
|
方法 |
|
在应用创建的影集中的指定位置添加丰富内容。 |
|
将用户 Google 相册媒体库中由应用创建的一项或多项媒体内容添加到由应用创建的影集。 |
|
从指定的应用创建的影集中移除一项或多项应用创建的媒体内容。 |
|
在用户的 Google 相册媒体库中创建影集。 |
|
根据指定的 albumId 返回应用创建的影集。 |
|
列出应用创建的所有影集。 |
|
使用指定的 id 更新应用创建的影集。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-04-01。
[[["易于理解","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"]],["最后更新时间 (UTC):2025-04-01。"],[[["Google Photos Albums are containers for media items and can be shared with others."],["Shared albums have properties controlling adding media and comments, along with shareable links and tokens."],["Albums include metadata such as title, product URL, cover photo, and media item count."],["Developers can programmatically manage albums using various methods like create, get, list, and update."],["Some album management method scopes are subject to removal or change."]]],["Google Photos albums, serving as media containers, include properties like `id`, `title`, and `productUrl`. Shared albums have `shareInfo`, which contains a `shareableUrl`, `shareToken`, and booleans for user interaction (`isJoined`, `isOwned`, `isJoinable`). Sharing options (`SharedAlbumOptions`) determine collaboration (`isCollaborative`) and commenting (`isCommentable`). Methods for albums include adding/removing media, creating, retrieving, updating (patching), and managing sharing (share/unshare, which will stop working after March 31, 2025).\n"]]