REST Resource: sessions
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
रिसॉर्स: PickingSession
उपयोगकर्ता सेशन की इमेज, जिसमें उपयोगकर्ता Google Photos का इस्तेमाल करके फ़ोटो और वीडियो चुन सकता है.
JSON के काेड में दिखाना |
{
"id": string,
"pickerUri": string,
"pollingConfig": {
object (PollingConfig )
},
"expireTime": string,
"pickingConfig": {
object (PickingConfig )
},
"mediaItemsSet": boolean
} |
फ़ील्ड |
id |
string
सिर्फ़ आउटपुट के लिए. इस सेशन के लिए Google से जनरेट हुआ आइडेंटिफ़ायर.
|
pickerUri |
string
सिर्फ़ आउटपुट के लिए. उपयोगकर्ता को Google Photos (वेब पर) पर रीडायरेक्ट करने के लिए इस्तेमाल किया जाने वाला यूआरआई, ताकि वे मौजूदा सेशन के लिए फ़ोटो और वीडियो चुन सकें. इस पेज को देखने के लिए, उपयोगकर्ता को अपने वेब ब्राउज़र में उस Google खाते में लॉग इन करना होगा जिसका मालिकाना हक इस सेशन पर है. सुरक्षा से जुड़ी वजहों से, pickerUri को iframe में नहीं खोला जा सकता.
|
pollingConfig |
object (PollingConfig )
सिर्फ़ आउटपुट के लिए. सुझाया गया कॉन्फ़िगरेशन, जिसका इस्तेमाल ऐप्लिकेशन को sessions.get को पोल करते समय करना चाहिए. इस फ़ील्ड में सिर्फ़ तब जानकारी भरी जाती है, जब इस सेशन के लिए मीडिया आइटम नहीं चुने गए हैं. mediaItemsSet गलत है).
|
expireTime |
string (Timestamp format)
सिर्फ़ आउटपुट के लिए. इस सेशन (और इसके चुने गए मीडिया आइटम) का ऐक्सेस खत्म होने का समय. आरएफ़सी 3339 का इस्तेमाल करता है. इसमें जनरेट किया गया आउटपुट हमेशा Z-नॉर्मलाइज़्ड होगा और इसमें 0, 3, 6 या 9 दशमलव अंक इस्तेमाल किए जाएंगे. "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)
सिर्फ़ आउटपुट के लिए. पोल के अनुरोधों के बीच का सुझाया गया समय. सेकंड में कुल अवधि, जिसमें दशमलव के बाद नौ अंक हो सकते हैं. यह अवधि 's ' पर खत्म होती है. उदाहरण: "3.5s" .
|
timeoutIn |
string (Duration format)
सिर्फ़ आउटपुट के लिए. वह समय जिसके बाद क्लाइंट को पोलिंग बंद करनी चाहिए. 0 वैल्यू का मतलब है कि अगर क्लाइंट ने पहले से ही पोलिंग बंद नहीं की है, तो उसे पोलिंग बंद कर देनी चाहिए. सेकंड में कुल अवधि, जिसमें दशमलव के बाद नौ अंक हो सकते हैं. यह अवधि '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 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 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. |"]]