瞭解新的 Picker API 和 Library API 的重要異動。詳情請參閱
本文。
REST Resource: sessions
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
資源:PickingSession
使用者工作階段的表示法,在此期間,使用者可以使用 Google 相簿挑選相片和影片。
JSON 表示法 |
{
"id": string,
"pickerUri": string,
"pollingConfig": {
object (PollingConfig )
},
"expireTime": string,
"mediaItemsSet": boolean
} |
欄位 |
id |
string
僅供輸出。Google 為這個工作階段產生的 ID。
|
pickerUri |
string
僅供輸出。用於將使用者重新導向至 Google 相簿 (網頁版),讓他們選擇目前工作階段的相片和影片。 如要成功查看這個頁面,使用者必須在網頁瀏覽器中登入擁有這個工作階段的 Google 帳戶。 基於安全考量,pickerUri 無法在 iframe 中開啟。
|
pollingConfig |
object (PollingConfig )
僅供輸出。應用程式在輪詢 sessions.get 時應使用的建議設定。 只有在未為這個工作階段選取媒體項目 (也就是 mediaItemsSet 為 false)。
|
expireTime |
string (Timestamp format)
僅供輸出。這個工作階段 (以及所選取的媒體項目) 的存取權到期時間。 採用 RFC3339 世界標準時間「Zulu」格式的時間戳記,精確度達奈秒單位,最多九個小數位數。例如 "2014-10-02T15:01:23Z" 和 "2014-10-02T15:01:23.045123456Z" 。
|
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" 。
|
方法 |
|
產生新工作階段,使用者可在該工作階段中選擇相片和影片供第三方存取。 |
|
刪除指定的工作階段。 |
|
擷取指定工作階段的相關資訊。 |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-11-21 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2024-11-21 (世界標準時間)。"],[[["Google Photos Picker API provides sessions for users to select photos and videos."],["`PickingSession` resource represents the user's selection session, including a URI to redirect users to Google Photos for picking media."],["Applications can poll the API using the recommended `PollingConfig` to check for session updates and retrieve selected media items."],["Sessions have an expiration time and can be programmatically created, retrieved, and deleted using the API methods."]]],["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"]]