Skip to content
Advertisement

Create a shortcut to file in Google Drive API PHP Client v2

As per Single-parenting behavior changes in Google Drive API, beginning Sept. 30, 2020, you will no longer be able to place a file in multiple parent folders. Now we should Create a shortcut to a Drive file instead.

Is it possible to create shortcut to the file with Google Drive PHP Client v2 or anyhow simple with PHP.

I have tryed:

JavaScript

I’m getting unknown parameter: 'shortcutDetails'

Advertisement

Answer

I believe your goal and situation as follows.

  • You want to create new shortcut using googleapis for php.
  • You have already been able to use Drive API.

In this case, I would like to propose to use setShortcutDetails() in your script. When your script is modified, it becomes as follows.

Modified script:

JavaScript
  • Please set $parent_id and $file_id.

References:

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement