Dies ist die alte Dokumentation für die Google Photos Library API.
REST Resource: sharedAlbums
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Ressource: Album
Darstellung eines Albums in Google Fotos. Alben sind Container für Medienelemente. Wenn ein Album von der Anwendung geteilt wurde, enthält es eine zusätzliche shareInfo
-Eigenschaft.
JSON-Darstellung |
{
"id": string,
"title": string,
"productUrl": string,
"isWriteable": boolean,
"shareInfo": {
object (ShareInfo )
},
"mediaItemsCount": string,
"coverPhotoBaseUrl": string,
"coverPhotoMediaItemId": string
} |
Felder |
id |
string
ID für das Album. Dies ist eine dauerhafte ID, die zwischen Sitzungen verwendet werden kann, um dieses Album zu identifizieren.
|
title |
string
Der Name des Albums, der dem Nutzer in seinem Google Fotos-Konto angezeigt wird. Dieser String darf maximal 500 Zeichen lang sein.
|
productUrl |
string
[Nur Ausgabe] Google Fotos-URL für das Album. Der Nutzer muss in seinem Google Fotos-Konto angemeldet sein, um auf diesen Link zugreifen zu können.
|
isWriteable |
boolean
[Nur Ausgabe] „Wahr“, wenn Sie in diesem Album Medienelemente erstellen können. Dieses Feld basiert auf den gewährten Bereichen und Berechtigungen des Albums. Wenn sich die Bereiche oder Berechtigungen des Albums ändern, wird dieses Feld aktualisiert.
|
shareInfo |
object (ShareInfo )
[Nur Ausgabe] Informationen zu geteilten Alben. Dieses Feld wird nur ausgefüllt, wenn das Album ein geteiltes Album ist, der Entwickler das Album erstellt hat und der Nutzer den Bereich photoslibrary.sharing gewährt hat.
|
mediaItemsCount |
string (int64 format)
[Nur Ausgabe] Die Anzahl der Medienelemente im Album.
|
coverPhotoBaseUrl |
string
[Nur Ausgabe] Eine URL zu den Bytes des Titelbilds. Sollte nicht in der vorliegenden Form verwendet werden. Parameter müssen vor der Verwendung an diese URL angehängt werden. Eine vollständige Liste der unterstützten Parameter finden Sie in der Entwicklerdokumentation. Mit '=w2048-h1024' werden beispielsweise die Abmessungen des Titelbilds auf eine Breite von 2.048 Pixel und eine Höhe von 1.024 Pixel festgelegt.
|
coverPhotoMediaItemId |
string
ID des Medienelements, das mit dem Titelbild verknüpft ist.
|
Methoden |
|
Gibt das Album basierend auf dem angegebenen shareToken zurück. |
|
Wenn jemand einem geteilten Album im Namen des Google Fotos-Nutzers beitritt |
|
Tritt im Namen des Google Fotos-Nutzers aus einem zuvor geteilten Album aus. |
|
Hier werden alle geteilten Alben aufgelistet, die in der Google Fotos App des Nutzers auf dem Tab „Teilen“ verfügbar sind. |
Sofern nicht anders angegeben, sind die Inhalte dieser Seite unter der Creative Commons Attribution 4.0 License und Codebeispiele unter der Apache 2.0 License lizenziert. Weitere Informationen finden Sie in den Websiterichtlinien von Google Developers. Java ist eine eingetragene Marke von Oracle und/oder seinen Partnern.
Zuletzt aktualisiert: 2025-07-25 (UTC).
[null,null,["Zuletzt aktualisiert: 2025-07-25 (UTC)."],[[["\u003cp\u003eAlbums in Google Photos are containers for media items and can be shared.\u003c/p\u003e\n"],["\u003cp\u003eShared albums have a \u003ccode\u003eshareInfo\u003c/code\u003e property and developers can access them with the \u003ccode\u003ephotoslibrary.sharing\u003c/code\u003e scope.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eAlbum\u003c/code\u003e resource provides methods to get, join, leave, and list shared albums.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eAlbum\u003c/code\u003e properties provide information such as ID, title, URL, writability status, media count, and cover photo details.\u003c/p\u003e\n"]]],["Albums in Google Photos are containers for media items, identified by a unique `id` and a user-facing `title`. Key details include the album's `productUrl`, whether it's `isWriteable`, `mediaItemsCount`, and cover photo information (`coverPhotoBaseUrl`, `coverPhotoMediaItemId`). Shared albums contain a `shareInfo` property. Actions include: retrieving albums with a `shareToken`, joining, leaving, and listing shared albums via methods such as `get`, `join`, `leave`, and `list`.\n"],null,["# REST Resource: sharedAlbums\n\n- [Resource: Album](#Album)\n - [JSON representation](#Album.SCHEMA_REPRESENTATION)\n- [Methods](#METHODS_SUMMARY)\n\nResource: Album\n---------------\n\nRepresentation 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.\n\n| JSON representation |\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"id\": string, \"title\": string, \"productUrl\": string, \"isWriteable\": boolean, \"shareInfo\": { object (/photos/library/legacy/reference/rest/v1/albums#Album.ShareInfo) }, \"mediaItemsCount\": string, \"coverPhotoBaseUrl\": string, \"coverPhotoMediaItemId\": string } ``` |\n\n| Fields ||\n|-------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `id` | `string` Identifier for the album. This is a persistent identifier that can be used between sessions to identify this album. |\n| `title` | `string` Name of the album displayed to the user in their Google Photos account. This string shouldn't be more than 500 characters. |\n| `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. |\n| `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. |\n| `shareInfo` | `object (`[ShareInfo](/photos/library/legacy/reference/rest/v1/albums#Album.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. |\n| `mediaItemsCount` | `string (`[int64](https://developers.google.com/discovery/v1/type-format)` format)` \\[Output only\\] The number of media items in the album. |\n| `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](https://developers.google.com/photos/library/guides/access-media-items#base-urls) 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. |\n| `coverPhotoMediaItemId` | `string` Identifier for the media item associated with the cover photo. |\n\n| Methods ------- ||\n|--------------------------------------------------------------------------|---------------------------------------------------------------------------------------|\n| ### [get](/photos/library/legacy/reference/rest/v1/sharedAlbums/get) | Returns the album based on the specified `shareToken`. |\n| ### [join](/photos/library/legacy/reference/rest/v1/sharedAlbums/join) | Joins a shared album on behalf of the Google Photos user. |\n| ### [leave](/photos/library/legacy/reference/rest/v1/sharedAlbums/leave) | Leaves a previously-joined shared album on behalf of the Google Photos user. |\n| ### [list](/photos/library/legacy/reference/rest/v1/sharedAlbums/list) | Lists all shared albums available in the Sharing tab of the user's Google Photos app. |"]]