Hier finden Sie Informationen zur neuen Picker API und zu wichtigen Änderungen an der Library API.
Weitere Informationen
REST Resource: sessions
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Ressource: PickingSession
Darstellung einer Nutzersitzung, in der der Nutzer Fotos und Videos mit Google Fotos auswählen kann.
JSON-Darstellung |
{
"id": string,
"pickerUri": string,
"pollingConfig": {
object (PollingConfig )
},
"expireTime": string,
"pickingConfig": {
object (PickingConfig )
},
"mediaItemsSet": boolean
} |
Felder |
id |
string
Nur Ausgabe. Die von Google generierte Kennung für diese Sitzung.
|
pickerUri |
string
Nur Ausgabe. Der URI, über den der Nutzer zu Google Fotos (im Web) weitergeleitet wird, damit er Fotos und Videos für die aktuelle Sitzung auswählen kann. Damit diese Seite angezeigt werden kann, muss der Nutzer in seinem Webbrowser in dem Google-Konto angemeldet sein, zu dem diese Sitzung gehört. Die pickerUri kann aus Sicherheitsgründen nicht in einem Iframe geöffnet werden.
|
pollingConfig |
object (PollingConfig )
Nur Ausgabe. Die empfohlene Konfiguration, die Anwendungen beim Abfragen von sessions.get verwenden sollten. Dieses Feld wird nur ausgefüllt, wenn für diese Sitzung noch keine Medienelemente ausgewählt wurden (d.h. mediaItemsSet ist falsch).
|
expireTime |
string (Timestamp format)
Nur Ausgabe. Zeitpunkt, zu dem der Zugriff auf diese Sitzung (und die ausgewählten Medienelemente) abläuft. Es wird RFC 3339 verwendet, wobei die generierte Ausgabe immer Z-normalisiert ist und 0, 3, 6 oder 9 Glieder mit Dezimalstellen enthält. Andere Achsenbezeichnungen als „Z“ sind ebenfalls zulässig. Beispiele: "2014-10-02T15:01:23Z" , "2014-10-02T15:01:23.045123456Z" oder "2014-10-02T15:01:23+05:30" .
|
pickingConfig |
object (PickingConfig )
Optional. Konfiguration der Bildauswahl für die Auswahl des Nutzers während dieser Sitzung. Dieser wird von der Clientanwendung beim Aufrufen von sessions.create angegeben und kann nicht nachträglich geändert werden, ohne eine neue Sitzung zu erstellen.
|
mediaItemsSet |
boolean
Nur Ausgabe. Wenn true festgelegt ist, wurden für diese Sitzung Medienelemente ausgewählt und deine Anwendung kann die Liste der ausgewählten Medienelemente über mediaItems.list anfordern.
|
PollingConfig
Konfiguration für das Abfragen der API.
JSON-Darstellung |
{
"pollInterval": string,
"timeoutIn": string
} |
Felder |
pollInterval |
string (Duration format)
Nur Ausgabe. Empfohlene Zeit zwischen Abfrageanfragen. Die Dauer in Sekunden mit bis zu neun Nachkommastellen und am Ende mit "s ". Beispiel: "3.5s" .
|
timeoutIn |
string (Duration format)
Nur Ausgabe. Die Zeitspanne, nach der der Client das Polling beenden soll. Der Wert 0 gibt an, dass der Client die Abfrage beenden soll, falls er dies noch nicht getan hat. Die Dauer in Sekunden mit bis zu neun Nachkommastellen und am Ende mit "s ". Beispiel: "3.5s" .
|
PickingConfig
Vom Kunden angegebene Konfiguration für die Auswahl des Nutzers während dieser Sitzung.
JSON-Darstellung |
{
"maxItemCount": string
} |
Felder |
maxItemCount |
string (int64 format)
Optional. Die maximale Anzahl von Artikeln, die der Nutzer während dieser Sitzung auswählen kann. Wenn keine Angabe gemacht wird, ist der Standardwert 2.000. Wenn nicht angegeben oder auf 0 festgelegt, können maximal 2.000 Artikel ausgewählt werden. Werte über 2.000 werden auf 2.000 festgelegt. Negative Werte führen zu einem INVALID_ARGUMENT -Fehler.
|
Methoden |
|
Erzeugt eine neue Sitzung, in der der Nutzer Fotos und Videos für den Zugriff von Drittanbietern auswählen kann. |
|
Löscht die angegebene Sitzung. |
|
Ruft Informationen zur angegebenen Sitzung ab. |
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\u003eGoogle Photos Picker API provides sessions for users to select photos and videos.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003ePickingSession\u003c/code\u003e resource represents the user's selection session, including a URI to redirect users to Google Photos for picking media.\u003c/p\u003e\n"],["\u003cp\u003eApplications can poll the API using the recommended \u003ccode\u003ePollingConfig\u003c/code\u003e to check for session updates and retrieve selected media items.\u003c/p\u003e\n"],["\u003cp\u003eSessions have an expiration time and can be programmatically created, retrieved, and deleted using the API methods.\u003c/p\u003e\n"]]],["A `PickingSession` represents a user's photo/video selection process in Google Photos, identified by a unique ID. It provides a `pickerUri` to direct users to Google Photos for media selection. `PollingConfig` defines API polling parameters with `pollInterval` and `timeoutIn`. A session expires at a specified `expireTime`, after which access ends. Once `mediaItemsSet` is true, selected media can be requested. Methods allow to `create`, `get` and `delete` sessions.\n"],null,["# REST Resource: sessions\n\n- [Resource: PickingSession](#PickingSession)\n - [JSON representation](#PickingSession.SCHEMA_REPRESENTATION)\n- [PollingConfig](#PollingConfig)\n - [JSON representation](#PollingConfig.SCHEMA_REPRESENTATION)\n- [PickingConfig](#PickingConfig)\n - [JSON representation](#PickingConfig.SCHEMA_REPRESENTATION)\n- [Methods](#METHODS_SUMMARY)\n\nResource: PickingSession\n------------------------\n\nRepresentation of a user session during which the user can pick photos and videos using Google Photos.\n\n| JSON representation |\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"id\": string, \"pickerUri\": string, \"pollingConfig\": { object (/photos/picker/reference/rest/v1/sessions#PollingConfig) }, \"expireTime\": string, \"pickingConfig\": { object (/photos/picker/reference/rest/v1/sessions#PickingConfig) }, \"mediaItemsSet\": boolean } ``` |\n\n| Fields ||\n|-----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `id` | `string` Output only. The Google-generated identifier for this session. |\n| `pickerUri` | `string` Output only. The URI used to redirect the user to Google Photos (on web) so they can pick photos and videos for the current session. To view this page successfully, the user must be logged into the Google account that owns this session in their web browser. The `pickerUri` cannot be opened in an iframe due to security reasons. |\n| `pollingConfig` | `object (`[PollingConfig](/photos/picker/reference/rest/v1/sessions#PollingConfig)`)` Output only. The recommended configuration that applications should use while polling `sessions.get`. This field is only populated if media items have not yet been picked for this session (i.e., `mediaItemsSet` is false). |\n| `expireTime` | `string (`[Timestamp](https://protobuf.dev/reference/protobuf/google.protobuf/#timestamp)` format)` Output only. Time when access to this session (and its picked media items) will expire. Uses RFC 3339, where generated output will always be Z-normalized and uses 0, 3, 6 or 9 fractional digits. Offsets other than \"Z\" are also accepted. Examples: `\"2014-10-02T15:01:23Z\"`, `\"2014-10-02T15:01:23.045123456Z\"` or `\"2014-10-02T15:01:23+05:30\"`. |\n| `pickingConfig` | `object (`[PickingConfig](/photos/picker/reference/rest/v1/sessions#PickingConfig)`)` Optional. Photo-picking configuration for the user's picking experience during this session. This is specified by the client application when calling `sessions.create`, and cannot be modified after the fact (without creating a new session). |\n| `mediaItemsSet` | `boolean` Output only. If set to `true`, media items have been picked for this session and your application can request the list of picked media items via `mediaItems.list`. |\n\nPollingConfig\n-------------\n\nConfiguration for polling the API.\n\n| JSON representation |\n|---------------------------------------------------------|\n| ``` { \"pollInterval\": string, \"timeoutIn\": string } ``` |\n\n| Fields ||\n|----------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `pollInterval` | `string (`[Duration](https://protobuf.dev/reference/protobuf/google.protobuf/#duration)` format)` Output only. Recommended time between poll requests. A duration in seconds with up to nine fractional digits, ending with '`s`'. Example: `\"3.5s\"`. |\n| `timeoutIn` | `string (`[Duration](https://protobuf.dev/reference/protobuf/google.protobuf/#duration)` format)` Output only. The length of time after which the client should stop polling. A value of 0 indicates that the client should stop polling if it hasn't already. A duration in seconds with up to nine fractional digits, ending with '`s`'. Example: `\"3.5s\"`. |\n\nPickingConfig\n-------------\n\nClient-specified configuration for the user's picking experience during this session.\n\n| JSON representation |\n|------------------------------------|\n| ``` { \"maxItemCount\": string } ``` |\n\n| Fields ||\n|----------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `maxItemCount` | `string (`[int64](https://developers.google.com/discovery/v1/type-format)` format)` Optional. The maximum number of items that the user can pick during this session. Defaults to 2000 if not specified. If unspecified or set to 0, at most 2000 items can be picked. Values above 2000 will be coerced to 2000. Negative values will result in an `INVALID_ARGUMENT` error. |\n\n| Methods ------- ||\n|----------------------------------------------------------------|--------------------------------------------------------------------------------------------------|\n| ### [create](/photos/picker/reference/rest/v1/sessions/create) | Generates a new session during which the user can pick photos and videos for third-party access. |\n| ### [delete](/photos/picker/reference/rest/v1/sessions/delete) | Deletes the specified session. |\n| ### [get](/photos/picker/reference/rest/v1/sessions/get) | Retrieves information about the specified session. |"]]