Method: spreadsheets.sheets.copyTo
Оптимизируйте свои подборки
Сохраняйте и классифицируйте контент в соответствии со своими настройками.
Копирует один лист из электронной таблицы в другую электронную таблицу. Возвращает свойства вновь созданного листа.
HTTP-запрос
POST https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}/sheets/{sheetId}:copyTo
URL-адрес использует синтаксис транскодирования gRPC .
Параметры пути
Параметры |
---|
spreadsheetId | string Идентификатор электронной таблицы, содержащей лист для копирования. |
sheetId | integer Идентификатор листа для копирования. |
Тело запроса
Тело запроса содержит данные следующей структуры:
JSON-представление |
---|
{
"destinationSpreadsheetId": string
} |
Поля |
---|
destinationSpreadsheetId | string Идентификатор электронной таблицы, в которую необходимо скопировать лист. |
Тело ответа
В случае успеха тело ответа содержит экземпляр SheetProperties
.
Области авторизации
Требуется одна из следующих областей OAuth:
-
https://www.googleapis.com/auth/drive
-
https://www.googleapis.com/auth/drive.file
-
https://www.googleapis.com/auth/spreadsheets
Дополнительную информацию см. в руководстве по авторизации .
Если не указано иное, контент на этой странице предоставляется по лицензии Creative Commons "С указанием авторства 4.0", а примеры кода – по лицензии Apache 2.0. Подробнее об этом написано в правилах сайта. Java – это зарегистрированный товарный знак корпорации Oracle и ее аффилированных лиц.
Последнее обновление: 2025-05-05 UTC.
[null,null,["Последнее обновление: 2025-05-05 UTC."],[],[],null,["# Method: spreadsheets.sheets.copyTo\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nCopies a single sheet from a spreadsheet to another spreadsheet. Returns the properties of the newly created sheet.\n\n### HTTP request\n\n`POST https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}/sheets/{sheetId}:copyTo`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|-----------------|------------------------------------------------------------------|\n| `spreadsheetId` | `string` The ID of the spreadsheet containing the sheet to copy. |\n| `sheetId` | `integer` The ID of the sheet to copy. |\n\n### Request body\n\nThe request body contains data with the following structure:\n\n| JSON representation |\n|------------------------------------------------|\n| ``` { \"destinationSpreadsheetId\": string } ``` |\n\n| Fields ||\n|----------------------------|----------------------------------------------------------|\n| `destinationSpreadsheetId` | `string` The ID of the spreadsheet to copy the sheet to. |\n\n### Response body\n\nIf successful, the response body contains an instance of [SheetProperties](/workspace/sheets/api/reference/rest/v4/spreadsheets/sheets#SheetProperties).\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/drive`\n- `https://www.googleapis.com/auth/drive.file`\n- `https://www.googleapis.com/auth/spreadsheets`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent)."]]