מידע נוסף על Picker API החדש ועל שינויים חשובים ב-Library API.
כאן יש פרטים.
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
פלט בלבד. מזהה ה-URI שמשמש להפניית המשתמש אל Google Photos (באינטרנט) כדי שיוכל לבחור תמונות וסרטונים לסשן הנוכחי. כדי להציג את הדף הזה, המשתמש צריך להתחבר לחשבון Google שבבעלותו הסשן הזה בדפדפן האינטרנט שלו. אי אפשר לפתוח את pickerUri ב-iframe מסיבות אבטחה.
|
pollingConfig |
object (PollingConfig )
פלט בלבד. ההגדרה המומלצת שבה צריכות להשתמש אפליקציות במהלך הסקרים של sessions.get . השדה הזה מתמלא רק אם עדיין לא נבחרו פריטי מדיה לסשן הזה (כלומר, mediaItemsSet הוא שקר).
|
expireTime |
string (Timestamp format)
פלט בלבד. המועד שבו יפוג תוקף הגישה לסשן הזה (ולפריטי המדיה שנבחרו בו). הפורמט הזה משתמש ב-RFC 3339, שבו הפלט שנוצר תמיד יהיה מנורמלי לפי Z וישמש בספרות עשרוניות של 0, 3, 6 או 9. אפשר להשתמש גם בשינויים (offsets) אחרים מלבד '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 .
|
Methods |
|
יצירת סשן חדש שבו המשתמש יכול לבחור תמונות וסרטונים שיהיו זמינים לצד שלישי. |
|
מחיקה של הסשן שצוין. |
|
אחזור מידע על הסשן שצוין. |
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת 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. |"]]