You are viewing the legacy documentation for the Google Photos Library API.
REST Resource: albums
Stay organized with collections
Save and categorize content based on your preferences.
Resource: Album
Representation 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.
JSON representation |
{
"id": string,
"title": string,
"productUrl": string,
"isWriteable": boolean,
"shareInfo": {
object (ShareInfo )
},
"mediaItemsCount": string,
"coverPhotoBaseUrl": string,
"coverPhotoMediaItemId": string
} |
Fields |
id |
string
Identifier for the album. This is a persistent identifier that can be used between sessions to identify this album.
|
title |
string
Name of the album displayed to the user in their Google Photos account. This string shouldn't be more than 500 characters.
|
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.
|
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.
|
shareInfo |
object (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.
|
mediaItemsCount |
string (int64 format)
[Output only] The number of media items in the album.
|
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 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.
|
coverPhotoMediaItemId |
string
Identifier for the media item associated with the cover photo.
|
ShareInfo
Information about albums that are shared. This information is only included if you created the album, it is shared and you have the sharing scope.
JSON representation |
{
"sharedAlbumOptions": {
object (SharedAlbumOptions )
},
"shareableUrl": string,
"shareToken": string,
"isJoined": boolean,
"isOwned": boolean,
"isJoinable": boolean
} |
Fields |
sharedAlbumOptions |
object (SharedAlbumOptions )
Options that control whether someone can add media items to, or comment on a shared album.
|
shareableUrl |
string
A link to the shared Google Photos album. Anyone with the link can view the contents of the album, so it should be treated with care. The shareableUrl parameter is only returned if the album has link sharing turned on. If a user is already joined to an album that isn't link-shared, they can use the album's productUrl to access it instead. A shareableUrl is invalidated if the owner turns off link sharing in the Google Photos app, or if the album is unshared.
|
shareToken |
string
A token that is used to join, leave, or retrieve the details of a shared album on behalf of a user who isn't the owner. A shareToken is invalidated if the owner turns off link sharing in the Google Photos app, or if the album is unshared.
|
isJoined |
boolean
True if the user is joined to the album. This is always true for the owner of the album.
|
isOwned |
boolean
True if the user owns the album.
|
isJoinable |
boolean
True if the album can be joined by users.
|
SharedAlbumOptions
Options that control the sharing of an album.
JSON representation |
{
"isCollaborative": boolean,
"isCommentable": boolean
} |
Fields |
isCollaborative |
boolean
True if the shared album allows collaborators (users who have joined the album) to add media items to it. Defaults to false.
|
Methods |
|
Adds an enrichment at a specified position in a defined album. |
|
Adds one or more media items in a user's Google Photos library to an album. |
|
Removes one or more media items from a specified album. |
|
Creates an album in a user's Google Photos library. |
|
Returns the album based on the specified albumId . |
|
Lists all albums shown to a user in the Albums tab of the Google Photos app. |
|
Update the album with the specified id . |
|
Marks an album as shared and accessible to other users. |
|
Marks a previously shared album as private. |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-09 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-09 UTC."],[[["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"]]