When a user selects one or more files, the Google Picker API returns a JSON-formatted object. Depending on the view from which the selection was made, different fields are included in this data object.
JSON representation |
---|
{ 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, }, ... ] } |
Fields | |
---|---|
action | The Action taken by the user to close the Google Picker dialog. |
description | A description of the item, if provided. |
duration | The duration of the selected video. |
embed_URL | A URL for an embeddable version of the item. |
icon_URL | A URL for a publicly accessible version for an icon, if available. |
is_new | True if the selected item was uploaded then immediately selected. |
item_URL | A URL linking directly to the item. |
item_id | ID of the selected item. |
item_name | Name of the selected item. |
MIME_type | The MIME type of the selected item (not valid for maps). |
parent_ID | ID of parent item, if applicable. |
service_id | A ServiceId that describes the service this file was picked from. |
thumbnail_height | The height of the publicly accessible thumbnail. |
thumbnail_URL | A URL for the publicly accessible thumbnail. |
thumbnail_width | The width of the publicly accessible thumbnail. |
timestamp | The number of milliseconds since January 1, 1970, 00:00:00 GMT. |
type | The Type of the selected item. |
user_query | Query string, if one was set in View.setQuery() . |
view_ID | The ViewId of the View the item was selected from. |
view_options | Additional information, if known. Otherwise undefined. |