AI-generated Key Takeaways
-
This operation adds one or more media items to a specified album in a user's Google Photos library, given the media items and album were created via the API.
-
The request body must contain a JSON array of media item identifiers (
mediaItemIds
) to be added to the album identified by thealbumId
path parameter. -
Each album can hold a maximum of 20,000 media items, and a single request can add up to 50 media items.
-
Proper authorization is required, utilizing one of the specified OAuth scopes for accessing and modifying the user's Google Photos library.
-
If successful, the API returns an empty response body, signifying the media items were added to the album.
Adds one or more media items in a user's Google Photos library to an album. The media items and albums must have been created by the developer via the API.
Media items are added to the end of the album. If multiple media items are given, they are added in the order specified in this call.
Each album can contain up to 20,000 media items.
Only media items that are in the user's library can be added to an album. For albums that are shared, the album must either be owned by the user or the user must have joined the album as a collaborator.
Partial success is not supported. The entire request will fail if an invalid media item or album is specified.
HTTP request
POST https://photoslibrary.googleapis.com/v1/albums/{albumId}:batchAddMediaItems
The URL uses gRPC Transcoding syntax.
Path parameters
Parameters | |
---|---|
albumId |
Required. Identifier of the |
Request body
The request body contains data with the following structure:
JSON representation |
---|
{ "mediaItemIds": [ string ] } |
Fields | |
---|---|
mediaItemIds[] |
Required. Identifiers of the |
Response body
If successful, the response body is empty.
Authorization scopes
Requires one of the following OAuth scopes:
https://www.googleapis.com/auth/photoslibrary
https://www.googleapis.com/auth/photoslibrary.appendonly
https://www.googleapis.com/auth/photoslibrary.sharing