REST Resource: albums

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

[Ouput only] 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

[Output only] 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
}
Fields
sharedAlbumOptions

object (SharedAlbumOptions)

Options that control the sharing of an album.

shareableUrl

string

A link to the album that's now shared on the Google Photos website and app. Anyone with the link can access this shared album and see all of the items present in the album.

shareToken

string

A token that can be used by other users to join this shared album via the API.

isJoined

boolean

True if the user has joined the album. This is always true for the owner of the shared album.

isOwned

boolean

True if the user owns the album.

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.

isCommentable

boolean

True if the shared album allows the owner and the collaborators (users who have joined the album) to add comments to the album. Defaults to false.

Methods

addEnrichment

Adds an enrichment at a specified position in a defined album.

batchAddMediaItems

Adds one or more media items in a user's Google Photos library to an album.

batchRemoveMediaItems

Removes one or more media items from a specified album.

create

Creates an album in a user's Google Photos library.

get

Returns the album based on the specified albumId.

list

Lists all albums shown to a user in the Albums tab of the Google Photos app.

share

Marks an album as shared and accessible to other users.

unshare

Marks a previously shared album as private.