REST Resource: sessions
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
리소스: PickingSession
사용자가 Google 포토를 사용하여 사진과 동영상을 선택할 수 있는 사용자 세션을 나타냅니다.
JSON 표현 |
{
"id": string,
"pickerUri": string,
"pollingConfig": {
object (PollingConfig )
},
"expireTime": string,
"pickingConfig": {
object (PickingConfig )
},
"mediaItemsSet": boolean
} |
필드 |
id |
string
출력 전용입니다. 이 세션에 대해 Google에서 생성한 식별자입니다.
|
pickerUri |
string
출력 전용입니다. 사용자가 현재 세션의 사진과 동영상을 선택할 수 있도록 웹의 Google 포토로 리디렉션하는 데 사용되는 URI입니다. 이 페이지를 보려면 사용자가 웹브라우저에서 이 세션을 소유한 Google 계정에 로그인해야 합니다. 보안상의 이유로 pickerUri 를 iframe에서 열 수 없습니다.
|
pollingConfig |
object (PollingConfig )
출력 전용입니다. 애플리케이션이 sessions.get 를 폴링하는 동안 사용해야 하는 권장 구성입니다. 이 필드는 이 세션에 아직 미디어 항목이 선택되지 않은 경우에만 채워집니다 (즉, mediaItemsSet 는 false입니다.
|
expireTime |
string (Timestamp format)
출력 전용입니다. 이 세션 (및 선택한 미디어 항목)에 대한 액세스 권한이 만료되는 시간입니다. 생성된 출력은 항상 Z-정규화되고 소수점 이하 자릿수가 0, 3, 6 또는 9인 RFC 3339를 사용합니다. 'Z' 이외의 오프셋도 허용됩니다. 예를 들면 "2014-10-02T15:01:23Z" , "2014-10-02T15:01:23.045123456Z" 또는 "2014-10-02T15:01:23+05:30" 입니다.
|
pickingConfig |
object (PickingConfig )
선택사항입니다. 이 세션 동안 사용자의 선택 환경을 위한 사진 선택 구성입니다. 이는 sessions.create 를 호출할 때 클라이언트 애플리케이션에서 지정하며, 새 세션을 만들지 않고는 나중에 수정할 수 없습니다.
|
mediaItemsSet |
boolean
출력 전용입니다. true 로 설정된 경우 이 세션에 미디어 항목이 선택되었으며 애플리케이션은 mediaItems.list 를 통해 선택된 미디어 항목 목록을 요청할 수 있습니다.
|
PollingConfig
JSON 표현 |
{
"pollInterval": string,
"timeoutIn": string
} |
필드 |
pollInterval |
string (Duration format)
출력 전용입니다. 폴링 요청 간의 권장 시간입니다. 소수점 아래가 최대 9자리까지이고 's '로 끝나는 초 단위 기간입니다. 예를 들면 "3.5s" 입니다.
|
timeoutIn |
string (Duration format)
출력 전용입니다. 클라이언트가 폴링을 중지해야 하는 시간입니다. 값이 0이면 클라이언트가 아직 폴링을 중지하지 않은 경우 중지해야 함을 나타냅니다. 소수점 아래가 최대 9자리까지이고 's '로 끝나는 초 단위 기간입니다. 예를 들면 "3.5s" 입니다.
|
PickingConfig
이 세션 동안 사용자의 선택 환경에 관한 클라이언트 지정 구성입니다.
JSON 표현 |
{
"maxItemCount": string
} |
필드 |
maxItemCount |
string (int64 format)
선택사항입니다. 사용자가 이 세션 중에 선택할 수 있는 최대 항목 수입니다. 지정하지 않을 경우 기본값은 2000입니다. 지정하지 않거나 0으로 설정하면 최대 2, 000개의 항목을 선택할 수 있습니다. 2,000을 초과하는 값은 2,000으로 변환됩니다. 음수 값을 사용하면 INVALID_ARGUMENT 오류가 발생합니다.
|
메서드 |
|
사용자가 서드 파티 액세스를 위해 사진 및 동영상을 선택할 수 있는 새 세션을 생성합니다. |
|
지정된 세션을 삭제합니다. |
|
지정된 세션에 대한 정보를 가져옵니다. |
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-07-25(UTC)
[null,null,["최종 업데이트: 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. |"]]