JSON 參考資料

使用者選取一或多個檔案時,Google Picker API 會傳回 JSON 格式物件。 此資料物件會包含不同欄位,實際情況則視選取的項目而定。

JSON 表示法
{
  Response.ACTION: action,
  Response.VIEW: [
    view_id,
    undefined,
    view_options {
      query: user_query,
      parent: parent_ID,
      ...
    }
  ],
  Response.DOCUMENTS: [
    {
      Document.DESCRIPTION: description,
      Document.DURATION: duration,
      Document.EMBEDDABLE_URL: embed_URL,
      Document.ICON_URL: icon_URL,
      Document.ID: item_id,
      Document.IS_NEW: is_new,
      Document.LAST_EDITED_UTC: timestamp,
      Document.MIME_TYPE: MIME_type,
      Document.NAME: item_name,
      Document.PARENT_ID: parent_ID,
        {
          type: phone_type,
          number: phone_number,
        }
        ...
      ],
      Document.SERVICE_ID: service_id,
      Document.THUMBNAILS: [
        {
          Thumbnail.URL: thumbnail_URL,
          Thumbnail.WIDTH: thumbnail_width,
          Thumbnail.HEIGHT: thumbnail_height
        }
        ...
      ],
      Document.TYPE: type,
      Document.URL: item_URL
    },
    ...
  ],
  Response.PARENTS: [
    {
      Document.DESCRIPTION: description,
      Document.LAST_EDITED_UTC: timestamp,
      Document.MIME_TYPE: MIME_type,
      Document.NAME: item_name,
      Document.ICON_URL: icon_URL,
      Document.ID: item_ID,
      Document.IS_NEW: is_new,
      Document.SERVICE_ID: service_id,
      Document.THUMBNAILS: [
        {
          Thumbnail.URL: thumbnail_URL,
          Thumbnail.WIDTH: thumbnail_width,
          Thumbnail.HEIGHT: thumbnail_height
        }
        ...
      ],
      Document.TYPE: type,
      Document.URL: item_URL,
    },
    ...
  ]
}
欄位
action使用者關閉 Google 挑選器對話方塊所使用的 Action
description商品說明 (如有提供)。
duration所選影片的時間長度。
embed_URL可嵌入項目的網址。
icon_URL圖示的可公開存取版本網址 (如果有的話)。
is_new如果選取的項目為上傳後立即選取,則為 True。
item_URL直接連結到該項目的網址。
item_id所選項目的 ID。
item_name所選項目的名稱。
MIME_type所選項目的 MIME 類型 (不適用於地圖)。
parent_ID上層項目的 ID (如適用)。
service_idServiceId 說明所選擇這個檔案的服務。
thumbnail_height可公開存取縮圖的高度。
thumbnail_URL可公開存取的縮圖網址。
thumbnail_width可公開存取的縮圖寬度。
timestamp自 1970 年 1 月 1 日 00:00:00 GMT 以來的毫秒數。
type所選項目的Type
user_query查詢字串 (如果已在 View.setQuery() 中設定)。
view_ID所選項目的 View ViewId
view_options已知的額外資訊。否則未定義。