Если вы используете Google Drive API версии 2, большая часть информации в руководстве по Google Drive API версии 3 также относится к версии 2. В этом разделе содержится вся информация, специфичная для версии 2 и отличающаяся от информации, представленной на отдельных страницах руководства по версии 3. Для получения полной информации каждый подраздел содержит ссылку на соответствующую страницу руководства.
For a complete list of differences, see Drive API v2 & v3 comparison reference .
Загрузка и публикация исправлений файлов.
On the Download & publish file revisions page, the following information is specific to v2, and replaces these sections shown for v3:
Список и загрузка отдельных исправлений
Получив список изменений файла, вы можете загрузить содержимое любого изменения, отправив авторизованный GET запрос на его свойство [] downloadUrl ](/workspace/drive/api/reference/rest/v2/revisions). Google Drive генерирует этот кратковременный URL-адрес при запросе изменения. Не полагайтесь на него для последующего использования.
You can also export the revision in one of the supported formats by checking the exportLinks property.
Пользовательские свойства файла
In addition to the information on the Add custom file properties page, the following information is specific to v2:
Properties are accessed using the properties resource.
This is the structure of a typical property that might be used to store a Drive file's database ID on the file.
{
'key': 'additionalID',
'value': 'ID',
'visibility': 'PRIVATE'
}
For more information about limits, see properties in the reference documentation.
Включить поддержку общих дисков
In addition to the information on the Implement shared drive support page, replace this additional field trashedDate for v2.
In Implement shared drive support , the following methods require supportsAllDrives=true when working with shared drives content:
-
files.get -
files.list -
files.insert -
files.update -
files.patch -
files.copy -
files.trash -
files.untrash -
files.delete -
files.touch -
children.insert -
parents.insert -
changes.list -
changes.getStartPageToken -
changes.get -
permissions.list -
permissions.get -
permissions.insert -
permissions.update -
permissions.patch -
permissions.delete
The changes.get and changes.list methods have several parameters specific to shared drives. For a list of parameters, see Track changes on a shared drive section.
Загрузка файлов
On the Upload file data page, notice this information is specific to v2:
Импорт в Google Документы (типы)
При создании файла в Google Диске вы можете преобразовать некоторые типы файлов в документы Google Docs, Google Sheets или Google Slides. Для этого укажите параметры запроса files.insert convert и задайте свойство mimeType файла (имя_рабочей_области). Дополнительную информацию см. в разделе «Загрузка данных файла» .
Обмен файлами, папками и дисками.
Обратите внимание, что на странице «Общий доступ к файлам, папкам и дискам» в версии 3 только одно поле, role , указывает фактические роли для пользователя, группы или домена. В версии 2 вам необходимо, чтобы поля role и additionalRoles в разрешении отражали фактические роли, которые пользователь, группа или домен имеют для данного элемента.
Различия в поисковых запросах для версии 2
The v2 title field is name in v3. For examples, see Search for files & folders .
The v2 createdDate field is createdTime in v3. For examples, see Search for shared drives .
The v2 modifiedDate field is modifiedTime in v3. The v2 lastViewedByMeDate field is viewedByMeTime in v3. For more details, see Search query terms & operators .