Reputation: 387
I am trying to get the shared drive id in the callback of the google picker. The response I am getting is attached in screenshot
These are the scopes for getting the drive data
Following is the code for creating picker
let view = new google.picker.DocsView()
.setOwnedByMe(false)
.setParent(vm.folderLocationId)
.setEnableDrives(true)
.setMimeTypes('application/vnd.google-apps.folder')
.setSelectFolderEnabled(true);
const picker = new google.picker.PickerBuilder()
.enableFeature(google.picker.Feature.NAV_HIDDEN)
.enableFeature(google.picker.Feature.MULTISELECT_ENABLED)
.enableFeature(google.picker.Feature.SUPPORT_DRIVES)
.setDeveloperKey(vm.api_key)
.setAppId(APP_ID)
.setOAuthToken(vm.access_token)
.addView(view)
.addView(new google.picker.DocsUploadView())
.setCallback(pickerCallback)
.build();
picker.setVisible(true);
async function pickerCallback(data) {
console.log('data', data)
}
This is the response of console.log
I am using gapi not google drive api for doing this.
Please let me know what I am doing wrong.
Thanks
Upvotes: 1
Views: 208
Reputation: 387
As I was trying to get the drive id by which I can access the folders of the shared drive.
I did it by adding the parameter of supportsAllDrives: true
Upvotes: 1