Rename Folder in Google Drive via API

2019-02-20 05:49发布

问题:

Is there a way to rename a Google Drive folder via the REST API?

The folders I want to do this with typically have subfolders and files inside them.

I've found documentation for renaming files, but nothing about folders.

回答1:

Use Drive API files.update. Your request body should look something like:

{
  "name": "newFileName"
}