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使用者選擇的 Action,用於關閉 Google Picker 對話方塊。
description項目說明 (如有提供)。
duration所選影片的時間長度。
embed_URL商品的可嵌入版本網址。
icon_URL可公開存取的圖示版本的網址 (如有)。
is_new如果所選項目隨後立即上傳,則為「是」。
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 算起的毫秒數。
type所選項目的 Type
user_query查詢字串 (如果在 View.setQuery() 中設定)。
view_ID所選項目的 View 中的 ViewId
view_options其他資訊 (如果知道的話)。否則為未定義。