REST Resource: sessions
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Zasób: PickingSession
Sesja użytkownika, podczas której może on wybierać zdjęcia i filmy w Zdjęciach Google.
Zapis JSON |
{
"id": string,
"pickerUri": string,
"pollingConfig": {
object (PollingConfig )
},
"expireTime": string,
"pickingConfig": {
object (PickingConfig )
},
"mediaItemsSet": boolean
} |
Pola |
id |
string
Tylko dane wyjściowe. Wygenerowany przez Google identyfikator tej sesji.
|
pickerUri |
string
Tylko dane wyjściowe. Identyfikator URI używany do przekierowywania użytkownika do Zdjęć Google (w wersji internetowej), aby mógł wybrać zdjęcia i filmy do bieżącej sesji. Aby wyświetlić tę stronę, użytkownik musi zalogować się w przeglądarce na konto Google, które jest właścicielem tej sesji. Ze względów bezpieczeństwa nie można otworzyć elementu pickerUri w ramce iframe.
|
pollingConfig |
object (PollingConfig )
Tylko dane wyjściowe. Zalecana konfiguracja, której aplikacje powinny używać podczas uzyskiwania dostępu do usługi sessions.get . To pole jest wypełnione tylko wtedy, gdy elementy multimedialne nie zostały jeszcze wybrane w tej sesji (tzn. mediaItemsSet ma wartość false (fałsz).
|
expireTime |
string (Timestamp format)
Tylko dane wyjściowe. Czas, w którym dostęp do tej sesji (i wybranych elementów multimedialnych) wygaśnie. Używa standardu RFC 3339, w którym wygenerowany wynik jest zawsze znormalizowany według normy Z i zawiera 0, 3, 6 lub 9 cyfr ułamkowych. Akceptowane są również przesunięcia inne niż „Z”. Przykłady: "2014-10-02T15:01:23Z" , "2014-10-02T15:01:23.045123456Z" lub "2014-10-02T15:01:23+05:30" .
|
pickingConfig |
object (PickingConfig )
Opcjonalnie: Konfiguracja wyboru zdjęć, która określa, jak użytkownik będzie wybierać zdjęcia w ramach tej sesji. Jest ona określana przez aplikację klienta podczas wywołania sessions.create i nie można jej zmienić w drobnych szczegółach (bez tworzenia nowej sesji).
|
mediaItemsSet |
boolean
Tylko dane wyjściowe. Jeśli wartość to true , oznacza to, że w ramach tej sesji wybrano elementy multimedialne, a Twoja aplikacja może poprosić o listę wybranych elementów multimedialnych za pomocą mediaItems.list .
|
PollingConfig
Konfiguracja pollingu interfejsu API.
Zapis JSON |
{
"pollInterval": string,
"timeoutIn": string
} |
Pola |
pollInterval |
string (Duration format)
Tylko dane wyjściowe. Zalecana przerwa między prośbami o ankietę Czas w sekundach z maksymalnie 9 miejscami po przecinku, zakończony literą „s ”. Przykład: "3.5s" .
|
timeoutIn |
string (Duration format)
Tylko dane wyjściowe. Czas, po którym klient powinien przestać wysyłać zapytania. Wartość 0 wskazuje, że klient powinien przestać wysyłać zapytania, jeśli jeszcze tego nie zrobił. Czas w sekundach z maksymalnie 9 miejscami po przecinku, zakończony literą „s ”. Przykład: "3.5s" .
|
PickingConfig
Konfiguracja określona przez klienta w celu wyboru przez użytkownika podczas tej sesji.
Zapis JSON |
{
"maxItemCount": string
} |
Pola |
maxItemCount |
string (int64 format)
Opcjonalnie: Maksymalna liczba elementów, które użytkownik może wybrać podczas tej sesji. Jeśli nie zostanie podany, przyjmuje się wartość 2000. Jeśli nie zostanie podana wartość lub zostanie ustawiona wartość 0, można wybrać maksymalnie 2000 elementów. Wartości powyżej 2000 zostaną sformatowane na 2000. Wartości ujemne spowodują błąd INVALID_ARGUMENT .
|
Metody |
|
Generuje nową sesję, podczas której użytkownik może wybrać zdjęcia i filmy, do których ma uzyskać dostęp aplikacja innej firmy. |
|
Usunięcie określonej sesji. |
|
Pobiera informacje o określonej sesji. |
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-07-25 UTC.
[null,null,["Ostatnia aktualizacja: 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. |"]]