Resource summary for Google Picker API
The Google Picker API uses a builder pattern with
PickerBuilder
and Picker
.
const picker = new google.picker.PickerBuilder()
.setOAuthtoken('TOKEN_FOR_USER')
.setAppId('1234567890') // Cloud Project number
.addView(google.picker.ViewId.DOCS)
.setCallback((data) => {
console.log(data);
})
.build();
picker.setVisible(true);
Classes
Name |
Description |
DocsUploadView |
Use DocsUploadView to upload files to Google Drive. |
DocsView |
Use DocsView to select files from Google Drive. |
Picker |
Picker is the top level object representing the UI action with the user. These objects are not created directly, but instead use the PickerBuilder class. |
PickerBuilder |
PickerBuilder is used to create Picker objects. Except where noted otherwise, the return type of methods below is of type PickerBuilder , allowing you to chain one call after another. |
ResourceId |
ResourceId is a utility class for generating resource IDs for documents. |
View |
An abstract class for all views. |
ViewGroup |
A ViewGroup is a visual grouping of views in the navigation pane. |
Enums
Name |
Description |
Action |
The action type for the ResponseObject . |
Audience |
Audience is an enumerated type used to describe the audience of the DocumentObject . |
DocsViewMode |
DocsViewMode is an enumerated type for displaying data within a DocsView. Use these values in calls to DocsView.setMode . |
Document |
Document is an enumerated type used to describe the fields of a DocumentObject . |
Feature |
Feature is an enumerated type, for turning on/off features for various views. Use these values in calls to PickerBuilder.enableFeature and PickerBuilder.disableFeature . |
Response |
Response is an enumerated type used to describe the fields of a ResponseObject . |
ServiceId |
ServiceId is an enumerated type used to describe the service the item was selected from. |
Thumbnail |
Thumbnail is an enumerated type describing the fields of a ThumbnailObject . |
Type |
The type of the selected item. |
ViewId |
ViewId is an enumerated type for the various views available in the Picker. Use these values in calls to DocsView and PickerBuilder . |
ViewToken |
ViewToken is an enumerated type used to describe the elements of a ResponseObject.viewToken . |
Interfaces
Name |
Description |
DocumentObject |
DocumentObject is an interface describing the attributes of a selected item. |
ResponseObject |
The response object passed to the callback method. |
ThumbnailObject |
ThumbnailObject is an interface describing the attributes of a photo or video. |
Type aliases
Name |
Description |
Locales |
The supported ISO 639 language codes for PickerBuilder.setLocale . |
ParentDocumentObject |
ParentDocumentObject is an interface describing the attributes of a parent folder for a selected item. |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-07 UTC.
[null,null,["Last updated 2024-10-07 UTC."],[[["The Google Picker API facilitates selecting or uploading files from Google Drive using a builder pattern with `PickerBuilder` and `Picker` objects."],["Developers can customize the Picker's appearance and functionality, such as specifying views (e.g., DocsView for file selection, DocsUploadView for uploads), OAuth token, and application ID."],["The API provides various classes and enums for controlling view modes, features, actions, and responses, offering flexibility in handling user interactions and selected items."],["Developers can access information about selected items through interfaces like `DocumentObject`, including file attributes and parent folder details."],["`PickerBuilder` offers methods to configure the picker's features, views, and callbacks, enabling developers to tailor it to their application's needs."]]],[]]