Method: spreadsheets.sheets.copyTo
Menyalin satu sheet dari spreadsheet ke spreadsheet lain. Menampilkan properti sheet yang baru dibuat.
Permintaan HTTP
POST https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}/sheets/{sheetId}:copyTo
URL menggunakan sintaksis gRPC Transcoding.
Parameter jalur
Parameter |
spreadsheetId |
string
ID spreadsheet yang berisi sheet yang akan disalin.
|
sheetId |
integer
ID sheet yang akan disalin.
|
Isi permintaan
Isi permintaan memuat data dengan struktur berikut:
Representasi JSON |
{
"destinationSpreadsheetId": string
} |
Kolom |
destinationSpreadsheetId |
string
ID spreadsheet tempat sheet akan disalin.
|
Isi respons
Jika berhasil, isi respons memuat instance SheetProperties
.
Cakupan otorisasi
Memerlukan salah satu cakupan OAuth berikut:
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.file
https://www.googleapis.com/auth/spreadsheets
Untuk informasi selengkapnya, lihat Panduan otorisasi.
Kecuali dinyatakan lain, konten di halaman ini dilisensikan berdasarkan Lisensi Creative Commons Attribution 4.0, sedangkan contoh kode dilisensikan berdasarkan Lisensi Apache 2.0. Untuk mengetahui informasi selengkapnya, lihat Kebijakan Situs Google Developers. Java adalah merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2024-11-08 UTC.
[null,null,["Terakhir diperbarui pada 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"]]