Method: spreadsheets.sheets.copyTo
Kopiuje jeden arkusz z jednego arkusza kalkulacyjnego do innego. Zwraca właściwości nowo utworzonego arkusza.
Żądanie HTTP
POST https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}/sheets/{sheetId}:copyTo
Adres URL używa składni transkodowania gRPC.
Parametry ścieżki
Parametry |
spreadsheetId |
string
Identyfikator arkusza kalkulacyjnego zawierającego arkusz, który chcesz skopiować.
|
sheetId |
integer
Identyfikator arkusza do skopiowania.
|
Treść żądania
Treść żądania zawiera dane o następującej strukturze:
Zapis JSON |
{
"destinationSpreadsheetId": string
} |
Pola |
destinationSpreadsheetId |
string
Identyfikator arkusza kalkulacyjnego, do którego chcesz skopiować arkusz.
|
Treść odpowiedzi
W przypadku powodzenia treść odpowiedzi obejmuje wystąpienie elementu SheetProperties
.
Zakresy autoryzacji
Wymaga jednego z tych zakresów OAuth:
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.file
https://www.googleapis.com/auth/spreadsheets
Więcej informacji znajdziesz w przewodniku dotyczącym autoryzacji.
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2024-11-08 UTC.
[null,null,["Ostatnia aktualizacja: 2024-11-08 UTC."],[[["Copies a single sheet from one Google Spreadsheet to another, returning the properties of the new sheet."],["Requires specifying the source spreadsheet and sheet IDs, along with the destination spreadsheet ID."],["Utilizes an HTTP POST request to `https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}/sheets/{sheetId}:copyTo`."],["Needs authorization with specific OAuth scopes like `https://www.googleapis.com/auth/drive` or `https://www.googleapis.com/auth/spreadsheets`."]]],["This content describes how to copy a sheet from one spreadsheet to another using an HTTP POST request to the Google Sheets API. The request URL requires the source `spreadsheetId` and `sheetId`. The request body needs a `destinationSpreadsheetId`. Upon success, the API returns the new sheet's properties. Authorization requires one of three specific OAuth scopes: `drive`, `drive.file`, or `spreadsheets`. The `try it!` section is a resource to help understand how the API works.\n"]]